這些只是2張圖片。一個與陰影一個沒有...
你必須創建這些圖像與CapInsets,使他們可以調整大小
例如
UIImage *buttonImage = [[UIImage imageNamed:@"yourImage"]
resizableImageWithCapInsets:UIEdgeInsetsMake(1, 11, 0, 20)];
要知道UIEdgeInsets的工作原理如下: How does UIEdgeInsetsMake work?
或者在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
您的意思是部分超越'Everywhere'細分市場的閃耀效應? –
不,我想畫的是上面的圖片。底部圖像正是上面使用皮革背景時的樣子。像底部光澤,頂部內部陰影和從上到下部分漸變,我只是不能看到如何以及在這個圖像中使用什麼效果。 –
沒有任何「效果」,這些圖像很可能是由設計師在Photoshop中製作的。 –