简体   繁体   English

我有带有导航的1x,2x,3x图像的图标

[英]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

Navigation Bar and Toolbar Icon Size 导航栏和工具栏图标大小

Use the following sizes for guidance when preparing custom navigation bar and toolbar icons, but adjust as needed to create balance. 准备自定义导航栏和工具栏图标时,请使用以下尺寸作为指导,但可以根据需要进行调整以创建平衡。

在此处输入图片说明

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM