あなたはタイルを張るためにコアグラフィックスメソッドで試すことができます、この質問からこのコードを見てください、
CGSize imageViewSize = imageView.bounds.size;
UIGraphicsBeginImageContext(imageViewSize);
CGContextRef imageContext = UIGraphicsGetCurrentContext();
CGContextDrawTiledImage(imageContext, (CGRect){ CGPointZero, imageViewSize }, tileImage);
UIImage *finishedImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
タイトル付きの画像を作成します。UIcontrolの背景として画像を設定できます。
編集:
tintColor
セグメント制御のデフォルトのグラデーションを作成するためのベースです。したがって、茶色のグラデーション画像を色合いの色として設定すると、黒いグラデーションが得られます。グラデーションの色を設定するには、
- サブクラス
uisegmentcontrol
クラスとオーバーライドdrawRect
メソッド。
backgroundImage
適切な画像インセットを使用して設定します。