I m very new to iOS programming. I m trying to set the toolbar background to a custom image. I m also using storyboards. How do I go about that? Do I edit UIToolbar in the UI Kit framework? Do I need to change something in Storyboard?
感谢
I m very new to iOS programming. I m trying to set the toolbar background to a custom image. I m also using storyboards. How do I go about that? Do I edit UIToolbar in the UI Kit framework? Do I need to change something in Storyboard?
感谢
您可使用
// portrait
[yourToolbar setBackgroundImage:[UIImage imageNamed:@"YourToolbarBkg-Portrait.png"] forToolbarPosition:UIToolbarPositionAny barMetrics:UIBarMetricsDefault];
// landscape
[yourToolbar setBackgroundImage:[UIImage imageNamed:@"YourToolbarBkg-Landscape.png"] forToolbarPosition:UIToolbarPositionAny barMetrics: UIBarMetricsLandscapePhone];
YourToolbarBkg-Portrait.png
will be 320x44 bkg image for portrait modeYourToolbarBkg-Landscape.png
will be 480x32 bkg image for landscape mode.UIToolbar 继承《统一法》的意见。 这只是对我的工作:
[topBar insertSubview:[[[UIImageView alloc] initWithImage:[UIImage imageNamed:BAR_BKG_IMG]] autorelease] atIndex:0];
<>UPDATED
上巴拉-乌ITool Bar u正在使用
use this code where u are creating ur UIToolBar the class which implements the UIToolbar.. plus tell me y r u using Toolbar whats ur main purpose for it
不要编辑UITool Bar,为什么不产生你喜欢的相同大小和皮肤的“ID”意见? 如果是新的,那将更加容易。
或者如果你想要推翻UIToolbar:
@implementation UIToolbar (CustomImage)
- (void)drawRect:(CGRect)rect {
UIImage *image = [UIImage imageNamed: @"image.png"];
[image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
}
@end
拥有工具Bars和Nav Bars的背景图像。 我知道,确定“纳巴”和“工具Bar”的背景形象通常是一个障碍。 但是,在你重新介绍“VC”模式时,出于某些内在原因,正在添加“Nav Bar”和“You DO”改变背景形象,其规模似乎翻了一番。 顶峰的沥滤有奇怪的结果。
我的问题是,我是在我全程使用一位纳吉勒先生的问题,但需要一个或两个方面的模式观点。 足够简单。 然而,我需要一名纳维亚·巴尔或多顿的“工具Bar”型头盔,把武库带走。 同样,不是一个问题。 但是,我需要“纳巴”或“工具Bar”,在我的“评估”中把“其他”放在其他地方。
我在《工具Bar》上定居,看到《世界宪章》正以模式提交。 因此,在典型的 Apple果蓝色中,我有工具包。 尼斯,但不是我的其他上诉人如何看待,每个纳巴都使用黑色形象。 我利用SiOS 5号外表代理,改变了工具Bar的背景形象。 这样做了。 但是,除非我对工具Bar预期的比例和规模有准确的估算,否则我就坐在一旁。 这种形象根本看不到。 因此,我决定发表《国际会计和报告准则》意见,在这些意见中,我可以控制内容模式,然后在《巴塞罗那工具》上插入一个分观点。
Take a look at my code below.
UIImageView *toolbarImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:NAV_BAR_BACKGROUND]];
[toolbarImageView setFrame:[self.IBOToolBar bounds]];
[toolbarImageView setContentMode:UIViewContentModeScaleAspectFill];
[self.IBOToolBar insertSubview:toolbarImageView atIndex:1];
它是一片 flu缩的脚石,但我确实希望这能帮助人们改变其工具Bar的形象。
NAV_BAR_BACKGROUND 定义如下:
#define NAV_BAR_BACKGROUND @"navBarBlackMattDarkSquare.png"
I have created a new iPhone application.I have two mach machines. I have created the certificate for running application in iPhone in one mac. Can I use the other mac for running the application in ...
HI, In our application i am using corelocationframework when opening application a alert for allow and dont allow.when clicking on the allow for current location we will show current location.When ...
Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...
我不禁要问,那里是否有任何实例表明从Peit向服务器发送音响。 I m不关心电话或SIP风格的解决办法,只是一个简单的袖珍流程......
我希望我与四舍五入的累进角进行网上讨论。
我正试图把图像放在搜索条左边。 但是,问题始于这里,搜索条线不能重新布署。
We have a restaurant table that has lat-long data for each row. We need to write a query that performs a search to find all restaurants within the provided radius e.g. 1 mile, 5 miles etc. We have ...
I like to write bash shell scripts on my iPhone, put them in an app folder with an icon, plist, etc., so they execute like apps by tapping their icon on SpringBoard. This is not interactive like ...