Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 像苹果一样展示维吾尔布托民族主义';s的iPad邮件应用程序_Objective C - Fatal编程技术网

Objective c 像苹果一样展示维吾尔布托民族主义';s的iPad邮件应用程序

Objective c 像苹果一样展示维吾尔布托民族主义';s的iPad邮件应用程序,objective-c,Objective C,苹果的iPadMail应用程序有几个图标,这些图标显示在分割视图控制器详细视图的导航项的区域中: 如何像这样将图标添加到navigationItem栏(我已经有图标了) 我的问题是UIBarButtonItem类引用似乎没有合适的UIBarButtonItemStyle,它不允许按钮周围有边框。我尝试过通过initWithCustomView配置uibarbuttonite,但点击按钮不起作用 提前感谢您的建议 干杯 编辑:我可以使用uiBarButtonimStyleplain,但是它看起来

苹果的iPadMail应用程序有几个图标,这些图标显示在分割视图控制器详细视图的导航项的区域中:

如何像这样将图标添加到navigationItem栏(我已经有图标了)

我的问题是UIBarButtonItem类引用似乎没有合适的UIBarButtonItemStyle,它不允许按钮周围有边框。我尝试过通过initWithCustomView配置uibarbuttonite,但点击按钮不起作用

提前感谢您的建议

干杯

编辑:我可以使用uiBarButtonimStyleplain,但是它看起来不像苹果按钮那样“嵌入”,这正是我想要的外观


我已经解决了这个问题,可以得出以下结果:

这是我使用的代码。可以对其进行优化,但出于演示目的,它很好且重复:

- (void)setupNavigationItemButtons {

float buttonWidth = 60;
float buttonHeight = 40;

UIImage *imageA = [UIImage imageNamed:@"212-action2.png"]; 
UIImage *imageB = [UIImage imageNamed:@"111-user.png"];
UIImage *imageC = [UIImage imageNamed:@"122-stats.png"];

UIButton *buttonA = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, buttonWidth, buttonHeight)];
UIButton *buttonB = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, buttonWidth, buttonHeight)];
UIButton *buttonC = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, buttonWidth, buttonHeight)];

[buttonA addTarget:self action:@selector(doSomething:)      forControlEvents:UIControlEventTouchUpInside];
[buttonB addTarget:self action:@selector(doSomethingElse:)  forControlEvents:UIControlEventTouchUpInside];
[buttonC addTarget:self action:@selector(doSomethingRandom:)forControlEvents:UIControlEventTouchUpInside];

[buttonA setImage:imageA forState:UIControlStateNormal];
[buttonB setImage:imageB forState:UIControlStateNormal];
[buttonC setImage:imageC forState:UIControlStateNormal];

UIBarButtonItem *buttonItemA = [[UIBarButtonItem alloc] initWithCustomView:buttonA];
UIBarButtonItem *buttonItemB = [[UIBarButtonItem alloc] initWithCustomView:buttonB];
UIBarButtonItem *buttonItemC = [[UIBarButtonItem alloc] initWithCustomView:buttonC];

[self.navigationItem setRightBarButtonItems:[NSArray arrayWithObjects:buttonItemA, buttonItemB, buttonItemC,nil]];

}

默认的
uibarbuttonimstyleplain
有什么问题吗?你好,大卫,谢谢你的回复。我编辑了原始帖子,以显示uibarbuttonimstyleplain的结果。不幸的是,这不是我想要实现的外观。这看起来像是带边框的样式,你确定它设置正确吗?在某些情况下,不支持普通样式。他们可能将其用作UIAVBar,但将其隐藏,并将按钮作为普通UIButtons放入。可以设置navbarhidden属性并执行任何操作。那样你就有更多的控制权了。