Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
したがって、カラー画像の長さは動的に変化します。カスタムグラフで使用します。これに対する最善の解決策は何ですか?現在、UIImage を拡張して Resize カテゴリを使用しています。よろしくお願いします..
このタスクでは、UIImage StretchableImageWithLeftCapWidth:topCapHeight:のインスタンス メソッドを使用できます。仮定する
UIImage
[imgObj stretchableImageWithLeftCapWidth:4.0f topCapHeight:5.0f];
このメソッド呼び出しは、画像の左右から 4 ピクセル、上下から 5 ピクセルをライブにし、残りの画像を中央で繰り返します。
しかし、あなたの場合、両方の値はZeroになります。