[英]I have Icon with 1x,2x,3x image with navigation
I have multi-image I add to bar item image but when I add it shows very big and I can't shrink them I don't know and I have costume back button but when I add it it shows far from the top left I use this code to add custom back but I add the bar item from storyboard if anyone can help. 我有多幅图像,我添加到了酒吧项目图像中,但是当我添加它时显示很大,我无法缩小它们,我不知道并且我有服装后退按钮,但是当我添加它时它显示的位置离左上角很远使用此代码添加自定义选项,但是如果有人可以帮助,我将从情节提要中添加栏项。
let backImg: UIImage = UIImage(named: "back-btn")!
let newBackButton = UIBarButtonItem(image: backImg, style: .plain, target: self, action: #selector(QuestionViewController.back(sender:)))
self.navigationItem.leftBarButtonItem = newBackButton
For navigation set icons in image assets (Assets.xcassets) 1X = 28x28 pixel, 2X = 56x56 pixel and 3X = 84x84 pixel icon size. 对于图像资产(Assets.xcassets)中的导航集图标,图标大小为1X = 28x28像素,2X = 56x56像素和3X = 84x84像素。
https://developer.apple.com/design/human-interface-guidelines/ios/icons-and-images/custom-icons/ https://developer.apple.com/design/human-interface-guidelines/ios/icons-and-images/custom-icons/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.