English 中文(简体)
UI BarButton 项目外表和组别
原标题:UIBarButtonItem appearance and setBackButtonBackgroundImage

I change my back button when pushing a new viewcontroller in my navigationcontroller. But it doesnt look nice and its stretched. Also, how can I remove the "News" title in my back button? here s my code. see the image

“cr

法典

[[UIBarButtonItem appearance] setBackButtonBackgroundImage:[UIImage imageNamed:@"back_button.png"] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];

我愿取得这样的成就:http://i228.photobucket.com/albums/ee262/romano2717/photo4.png”rel=“nofollow noretinger”http://i228.photobucket.com/albums/ee262/romano2717/photo4.png。

问题回答

利用以下代码使图像发挥作用。

int imageSize = 20; //REPLACE WITH YOUR IMAGE WIDTH

UIImage *barBackBtnImg = [[UIImage imageNamed:@"NavBackButton"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, imageSize, 0, 0)];

[[UIBarButtonItem appearance] setBackButtonBackgroundImage:barBackBtnImg 
                                                  forState:UIControlStateNormal 
                                                barMetrics:UIBarMetricsDefault];

你们可以利用可再生的电离层电离层电离层,以具体说明哪些标准不应延伸。 如果你把你的形象传到那里,你就赢得了你们的形象。

You don t have to put it in the .m file btw. (You could use the appDelegate.m file) just make sure it get s called before the NavigationBar is drawn.

除非我没有一件事,否则你必须在法典中设立国际律师联合会,以删除或改变名称,因此,它只适用于你把该守则列入的观点控制者:

UIBarButtonItem *myBackButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"back_button.png"] style:UIBarButtonItemStyleBordered target:nil action:nil];
self.navigationItem.backBarButtonItem = myBackButton;
[myBackButton release];

你颁布的法典之所以如此,是因为它只规定了背景和文件确实表明:

取得良好成果 图像必须具有可观的形象。

你们可以创造Button习俗,并把它作为避风港。 或者,你可以获取关于后纽州面积的图象。

删除子公司的名称:<条码>本身,标题=“;,以考虑到WillDisappear方法,并在考虑到WillAppear方法时再次确定所有权。

希望这将解决你的问题。

Use youparentViewController.title = @" "; I did have the same problem with the title





相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...

热门标签