- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我尝试使用图像作为导航栏背景,但无法到达边缘:
我设置的图像尺寸是 320 x 44 和 640 x 88。
这是设置它的代码:
self.navigationItem.titleView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"navBar.png"]];
最佳答案
它将适用于整个应用程序。
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
UINavigationBar *navigationBar = [UINavigationBar appearance];
UIImage *image = [UIImage imageNamed:@"navBar.png"];
[navigationBar setBackgroundImage:image forBarMetrics:UIBarMetricsDefault];
}
关于ios - UINavBar 将图像拉伸(stretch)到边缘,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16326319/
在我的 swift iOS 8 项目中,我将后退按钮图像更改为后退箭头,并使用 AppDelegate 中的以下代码删除了后退项目文本,但仍然得到了重叠的项目。 UINavigationBar.ap
我创建了一个带有侧面菜单的应用程序,例如 facebooks。我有一个 Root View Controller ,它在自身上添加了一个 View ,然后当用户按下“菜单”按钮时,它会将 View 滑
我尝试使用图像作为导航栏背景,但无法到达边缘: 我设置的图像尺寸是 320 x 44 和 640 x 88。 这是设置它的代码: self.navigationItem.titleView = [[U
我以编程方式创建了一个 UIPickerView,我目前从 UITextField 调用它。相反,我想在用户按下在导航栏上以编程方式创建的按钮时调用 datePicker。这是我的 datePicke
我有一个 UITableViewController 的子类,我想向它添加一个 UINavBar。它与 native 联系人应用程序非常相似,您可以在其中点击“添加联系人”,它会呈现一个分组的表格 V
目前正在构建商店应用程序。我有一个 Collection View ,显示带有价格和标题的服装图像。我希望用户能够使用一个特殊的栏来过滤和优化结果并更改页面布局,该栏将向下滑动并在 UINavBar
我是一名优秀的程序员,十分优秀!