uibarbuttonitem相关内容
所以这在将项目添加到导航栏时有效,但是当我通过界面构建器将其添加到底部栏中设置的工具栏时,背景图像不显示. UIBarButtonItem *resetButtonItem = [[UIBarButtonItem alloc]initWithTitle:@"Reset" style:UIBarButtonItemStylePlain target:self action:@selector(
..
使用此方法更改后退导航按钮的标题和背景图像.标题已更改但按钮保持黑色 - (void)viewDidLoad{[超级viewDidLoad];[self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"topBarbackground.png"] forBarMetrics:UIBarMetr
..
如何实现:我有一个带有搜索图标的 UIBarButtonItem,点击它后,我想在导航栏中显示搜索栏,点击搜索栏中的取消按钮,我想在没有搜索的情况下显示导航栏IOS 7 日历应用中的按钮和标题. 解决方案 为您的搜索按钮设置一个动作以呈现一个 UISearchController.请参阅 Apple 的 UICatalog 示例代码: - (IBAction)searchButtonCl
..
我有一个 UINavigationController,toolbarHidden 设置为 NO. 我已将 UIBarButtonItems 添加到 navigationController.toolbar. 工具栏显示了,但按钮不... 是什么? 解决方案 好吧,显然我误解了 navigationController 上 setItems 方法的用法. 为了解决这
..
我正在尝试使用 self.searchDisplayController.displaysSearchBarInNavigationBar = YES; 将 UISearchBar 添加到 UINavigationbar UISearchBar 被很好地添加到 UINavigationBar 中,但左/右 UIBarButtons 不见了.我就是不知道如何添加它们. 安迪对此有何想法或示
..
我正在使用 this 控件在 barbuttonitem 上显示徽章.它适用于导航控制器堆栈中的第一个控制器或根控制器.在推到另一个控制器时,我尝试显示徽章,但在那里看不到任何效果. 解决方案 你应该第一次在 viewDidLayoutSubviews 中设置badgeValue.在这种情况下,它会出现并且不会闪烁,就像您在 viewDidAppear 中设置它一样: - (void)
..
我有一个从 UIBarButtonItem 呈现的 UIPopoverController.我希望在弹出框之外进行触摸以消除弹出框.从条形按钮呈现弹出窗口时,其他条形按钮会自动包含在弹出窗口传递视图中.为了防止我在呈现弹出窗口后将直通视图设置为 nil(或 @[ ]),如下所示: - (IBAction) consoleBarButtonHit:(id)sender {UIViewControl
..
我写在我的代码中 [[UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class], nil] setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor lightGrayColor], NSFontAttributeName:[UIFont bold
..
如何将自定义 UIBarButtonItem 添加到导航栏右侧. public UIBarButtonItem btn_Cart {get;放;}公共详细控制器(){string buttonTitle = "一";btn_Cart = new UIBarButtonItem (buttonTitle, UIBarButtonItemStyle.Bordered, null);btn_Cart.
..
如果您有一个没有 Bar Button Items 的导航控制器,一个导航后退按钮将显示为最后一个视图控制器的名称. 我想保留那个名字,因为我不想硬编码它.我确实知道如何添加它,但我不想这样做,因为这会为错误留下更多空间. 有没有办法让我拥有一个左侧的 Bar Button Item 而默认的 Bar Button 不会消失? 解决方案 在 viewController 中添加
..
let searchBtn = UIBarButtonItem(image: UIImage(named: "ic_search"), style: .plain, target: self, action: #selector(self.searchButton))let moreBtn = UIBarButtonItem(image: UIImage(named: "ic_more"), s
..
我想通过更改其背景颜色来指示特定的 UIBarButtonItem 是打开还是关闭.移动版 Safari 使用此功能来指示是开启还是关闭隐私浏览: 我该怎么做,因为 UIBarButtonItem 上没有 backgroundColor 属性? 解决方案 创建一个 UIButton 并将其用作 UIBarButtonItem 的自定义视图.然后,在按钮的图层上设置background
..
我是一名初学 iPhone 开发者. 如何以编程方式设置 UIBarButtonItem 的标题? 我的代码如下: self.navigationItem.rightBarButtonItems =UIBarButtonItem(barButtonSystemItem: .Cancel, 目标: self,动作:“barButtonItemClicked:")@IBAction fu
..
我尝试将右侧栏按钮项的字体颜色更改为紫色,但它仍然显示为白色.我已经咨询过这个问题和这个问题.我该如何解决这个问题? 代码 let sortButton = UIButton(frame: CGRect(x: 0, y: 0, width: 34, height: 15))sortButton.setTitle("SORT", for: .normal)sortButton.titleLa
..
我像这样以编程方式在 UITableView 单元格中创建 UIBarbUttonItem : func setupChildrenPicker(){让选择按钮 = UIBarButtonItem(title: Wordings.BTN_CHOOSE, style: UIBarButtonItemStyle.done, target: nil, action: #selector(self.pi
..
你好 StackOverflow 社区, 我有一个相当奇怪的案例,我的导航控制器导航栏上的自定义后退按钮在交互时消失了. 一些额外的信息是我的代码没有使用 Storyboard 而我使用的是 UIKit - 包括 UI 在内的一切都是以编程方式构建的. 这是我的设置: 我首先创建一个自定义 UINavigationController 子类来抽象我所有与导航控制器相关的自定
..
我正在尝试在后栏按钮项上设置属性字符串. 这是我第一次尝试使用属性字符串. 代码如下: self.navigationItem.hidesBackButton = true让 barButtonBackStr = " 这会导致 Xcode 中出现以下错误. 无法使用参数调用类型“UIBarButtonItem"的初始化程序类型列表'(标题:NSMutableAttributedSt
..
我在导航栏的自定义右侧栏按钮项中添加了一个自定义按钮,如图所示. 我希望能够删除按钮后的空格,使其接触屏幕的右边缘,但即使在搜索后也找不到解决方案.如果有人能提到如何,那就太好了. 这是我正在使用的代码 UIButton *aButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];aButton.frame = CGRec
..
我以编程方式创建了一个工具栏,并在其中添加了 UIBarButtonItem. 这是目前的样子: 我希望按钮具有边框和圆角半径(弯角).将如何实施? UIBarButtonItem 实现代码: let okBarBtn = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.Done, target: self,
..
我想将带有代码的 UIBarButtonItem 的标识符从“播放"更改为“暂停".我该怎么做? 谢谢 解决方案 1) 初始化一个新按钮 //改播放let button = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.Play, target: self, action: "someAction")navig
..