我可以看到这一点(文字应该是“项目”,它显示“我... m”)
当我尝试使用故事板添加导航栏项目时。谁知道为什么? 这就是我添加该按钮的方式:
<option value="<?php echo $id;?>"><?php echo $stringversion;?></option>
答案 0 :(得分:1)
将UIButton作为UIBarButton的customView来设置UIBarButton的自定义宽度。
// create the nav bar back button
UIButton *backButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 50, 24)];
[backButton setTitle:@"Item" forState:UIControlStateNormal];
[backButton addTarget:self action:@selector(backButtonAction) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *buttonItem = [[UIBarButtonItem alloc] initWithCustomView:backButton];
self.navigationItem.leftBarButtonItem = buttonItem;