簡體   English   中英

需要顏色來構建自定義UIButton以便放置在UIBarButton中

[英]Need color to build a custom UIButton to put inside a UIBarButton

我需要構建一個自定義UIBarButton。 除了無法獲得與iPhone UIBarButton匹配的按鈕顏色之外,我所做的大部分工作都可以正常工作。 我該如何搭配?

這是我所擁有的:(主要是從Elements示例項目中提取的)

UIButton *localFlipIndicator=[[UIButton alloc] initWithFrame:CGRectMake(0,0,50,28)];
self.flipIndicatorButton=localFlipIndicator;
[flipIndicatorButton.titleLabel setFont:[UIFont systemFontOfSize:13]];
flipIndicatorButton.layer.cornerRadius=8.0;
flipIndicatorButton.layer.borderWidth=0.5;

[localFlipIndicator release];

[flipIndicatorButton setTitle:@"Back" forState:UIControlStateNormal];

UIBarButtonItem *flipButtonBarItem;
flipButtonBarItem=[[UIBarButtonItem alloc] initWithCustomView:flipIndicatorButton];
style:UIBarButtonItemStylePlain target:self action:@selector(flipCurrentView)];

[self.navigationItem setRightBarButtonItem:flipButtonBarItem animated:YES];

[flipButtonBarItem release];

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM