Tag: uibarbuttonitem

UIBarButtonItem UINavigationBar中的自定义视图

我正在为uinavigationbar自定义栏button,我正在使用以下代码 UIImageView *backImgView= [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"chk_back.png"]]; [backImgView setUserInteractionEnabled:YES]; UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithCustomView:backImgView]; [backButton setTarget:self]; [backButton setAction:@selector(BackBtn)]; checkIn_NavBar.topItem.leftBarButtonItem = backButton; 问题是没有调用它的行为。 我做错了什么?

如何以编程方式触发uibarbuttonitem点击事件

我已经创build了UIActionSheet UIActionSheet * action = [[UIActionSheet alloc]initWithTitle:@"" delegate:self cancelButtonTitle: @"cancel" destructiveButtonTitle: @"OK" otherButtonTitles: nil]; [action showInView:self.view]; [action release]; 在UIActionSheet取消button的事件我想要触发一个UIBarButtonItem事件,这是在我看来。 我的问题是我怎样才能触发UIActionSheet委托方法中的button事件(无需触摸button)

UIBarButtonItem在导航栏编程?

我一直在寻找这个解决scheme一段时间,但没有得到任何。 例如一个解决scheme是 self.navigationItem.setRightBarButtonItem(UIBarButtonItem(barButtonSystemItem: .Stop, target: self, action: nil), animated: true) 这段代码将添加一个“停止”图像的button。 就像这样,还有其他的解决scheme,“search”,“刷新”等等。但是,如果我想用我想要的图像以编程方式添加button怎么办?

为UIBarButtonItem设置图像 – 图像拉伸

当我尝试使用UIBarButtonItem的“initWithImage”来初始化一个导航栏的自定义图像时,它会在黑色的导航栏上显现出来,并被拉伸。 这是我创build它的方式: UIBarButtonItem *button = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"gear.png"] style:UIBarButtonItemStyleBordered target:self action:@selector(showSetting:)]; 这是它的样子: 任何想法,如果这是一个问题的形象? 我从我买的一套图标中得到了它。

增加NavigationBar高度

我有以下代码: func navbarbutton() { UIView.animateWithDuration(0.2, animations: { () -> Void in let current = self.navigationController?.navigationBar.frame self.navigationController?.navigationBar.frame = CGRectMake(self.frame!.origin.x, self.frame!.origin.y, self.frame!.size.width, current!.size.height + 50) self.navigationController?.navigationBar.layoutIfNeeded() }) } 我能够将导航栏的高度提高50 dp。 这对我来说不是问题。 我遇到的问题是, UIBarButtonItems都alignment到底部。 我怎样才能让他们alignment顶部,以便我可以自己添加更多的底部? 我根据图像得到一些东西: 是否有可能把它alignment到顶部?

如何在UIBarbutton项目上添加徽章?

你好朋友是新的iphone开发。 我正努力在右边的UIBarbutton项上添加徽章值。 我试过了,但是我不能解决这个问题。 谁能帮我。 提前致谢!

如何closures故事板popup窗口

我使用Xcode Storyboards创build了一个UIBarButtonItem (所以没有代码),像这样: 呈现popover工作得很好。 但是,当我点击出现的UIBarButtonItem时,我无法让UIBarButtonItem 消失 。 当按下(第一次)button时,popup窗口出现。 当再次按下button时(第二次),顶部会出现相同的popup窗口,所以现在我有两个popup窗口(或更多,如果我继续按下button)。 根据iOS人机界面指南,我需要让popover出现在第一个水龙头上,然后消失在第二个水龙头上: 确保一次只能在屏幕上看到一个popup窗口。 您不应该同时显示多个popup窗口(或devise为看起来和行为像popup窗口的自定义视图)。 特别是,你应该避免同时显示一个级联或层级的popovers,其中popover从另一个出现。 当用户UIBarButtonItem点击UIBarButtonItem时,我怎样才能closurespopup窗口?

如何在UINavigationBar 中编辑左侧,右侧UIBarButtonItem的空白空间

我早些时候使用的是iOS 6.1,但是现在我已经转移到了iOS 7.除了其他问题,我还观察到在我的导航栏中,左侧栏button项目的左侧空间和右侧button栏项目的右侧空白区域相当在IOS 7中比在iOS 6中更多。 我需要知道是否有一种方法可以减less导航栏中的左侧,右侧栏button项目的空白空间? 提前致谢。