ios - UINavigationBar 右键太高

标签 ios xcode cocoa-touch

我正在为 UINavigationBars 和 UIToolbars 使用自定义图像。我遇到的问题是我的其中一个使用 UINavigationBar 的 View ,右侧按钮显得太高 enter image description here 在使用 UIToolbar 的 View (模态视图,因此没有导航栏)上,它们看起来不错 enter image description here

什么可能导致按钮太大?我尝试在 IB 中添加按钮并使用代码。然后像这样设置图像

UIImage *barButton = [[UIImage imageNamed:@"ButtonBlue"] resizableImageWithCapInsets:UIEdgeInsetsMake(6, 8, 6, 8)];
        [self.connectButton setBackgroundImage:barButton forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];

谢谢

最佳答案

创建一个较小的按钮。您可以在预览中执行此操作 - 调整其大小。确保您也有@2x 尺寸。我记不起这些图像的推荐尺寸 - 大约是 30 点左右(搜索一下,您肯定会找到它)。

关于ios - UINavigationBar 右键太高,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12651478/

相关文章:

php - 如何在 PHP 中返回相对时间或在接收者(xCode)端自动转换它?

objective-c - 比较两个数组忽略顺序

swift - Google Auth 登录对成员 'subscript' 的引用不明确

objective-c - 在 iOS 中再次从其自己的委托(delegate)中打开 UIAlertView 失败

ios - 如何将多个贝塞尔曲线路径添加到同一 View swift 3

android - 如何在 iPhone 和 Android 的 Titanium 中实现 Google Analytic?

ios - UITableViewCell 中 UILabel 的布局警告不明确

ios - 页面 View Controller : Determining "next" and "previous" when using Core Data

objective-c - Objective C - 调用另一个类

html - 从 cloudkit 下载 html 文件