我在练习带导航栏的APP展。 使用UIBarButton从主画面移动到下一个画面。
uibutton * move left=[ uibuttonbuttonwithtype : uibuttontypecustom ];
[ moveleftsettitle : @ ' next screen ' forstate : uicontrolstatenormal ]
move left.title label.font=[ uifontfontwithname : @ ' Helvetica-bold ' size :12.0 f ];
[ move left.layersetcornerradius :4.0 f ]
[ move left.layersetborderwidth :1.0 f ]
[ move left.layersetbordercolor : [ [ uicolorredcolor ] CG color ];
move left.frame=cgrectmake (200,100.0,90.0,30.0 );
[ moveleftsettitlecolor : [ uicolorgreencolor ] forstate 3360 uicontrolstatenormal ]
[ moveleftaddtarget :自操作: @ selector (move to next ) forcontrolevents 3360 uicontroleventtouchupinside ]
uibarbuttonitem * bar button=[ [ uibarbuttonitemalloc ] initwithcustomview 3360 move left ];
self.navigation item.rightbarbuttonitem=bar button;
但是,现在第二个画面出现的时候,没有导航栏。 以下是此APP应用程序的屏幕截图
我也尝试了UIBarButton,但是第二个屏幕还没有导航栏。
uibarbuttonitem * back=[ [ uibarbuttonitemalloc ] initwithtitle : @ ' back ]
style : uibarbuttonitemstyleplain
目标: nil
动作: nil ];
selfnavigationitem setbackbarbuttonitem 3360 back;
我的问题是如何显示返回第二个画面的按钮? 我没有做任何定制按钮,但是默认情况下也不会自动进入。 请指导我。