2012-06-28 39 views
2

開始Ÿ軸距我對rightBarButtonItem變化rightBarButtonItem

UIButton *button1 = [[UIButton alloc] init]; 
button1.frame=CGRectMake(0,0,105,30); 
[button1 setBackgroundImage:[UIImage imageNamed: @"image1.png"] forState:UIControlStateNormal]; 
[button1 addTarget:appDelegate action:@selector(Open_Link1) forControlEvents:UIControlEventTouchUpInside]; 

self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:button1]; 
[button1 release]; 

以下自定義按鈕我需要移動rightBarButtonItem了2像素...

我試着將它設置,但沒有按不行!

回答

0

這裏嘗試改變這種button1.frame=CGRectMake(0,0,105,30);button1.frame=CGRectMake(0,-2,105,30);

+0

我已經嘗試過這一點,但沒辦法! –

+0

然後我怕你必須改變iteslf –

+0

我已經看到了這個類似的問題,圖像http://stackoverflow.com/questions/9866062/can-i-change-the-position-of-navigationbar-item,但不能得到任何東西out ...你能幫忙嗎? –

相關問題