これらは2枚の画像です。影のあるものと影のないもの…</p>
サイズ変更可能にするには、CapInsets を使用してこれらの画像を作成する必要があります
例えば
UIImage *buttonImage = [[UIImage imageNamed:@"yourImage"]
resizableImageWithCapInsets:UIEdgeInsetsMake(1, 11, 0, 20)];
UIEdgeInsets がどのように機能するかを知るには: UIEdgeInsetsMake
はどのように機能しますか?
またはApple Docで:
UIEdgeInsetsMake
Creates an edge inset for a button or view.
UIEdgeInsets UIEdgeInsetsMake (
CGFloat top,
CGFloat left,
CGFloat bottom,
CGFloat right
);
Parameters
top
The inset at the top of an object.
left
The inset on the left of an object
bottom
The inset on the bottom of an object.
right
The inset on the right of an object.
Return Value
An inset for a button or view
Discussion
An inset is a margin around the drawing rectangle where each side (left, right, top, and bottom) can have a different value.
Availability
Available in iOS 2.0 and later.
See Also
http://developer.apple.com/library/ios/#documentation/uikit/reference/UIKitFunctionReference/Reference/reference.html