如何将UIBarButtonItem作为图像移动到左侧,将其用作菜单按钮?

问题描述 投票:0回答:2

每当我尝试将图像设置为UIBarButtonItem时,它都会被放置在条形图的中心。如何通过以编程方式设置按钮的图像将其移动到左侧以将其用作菜单按钮? enter image description here

ios swift uibarbuttonitem xcode9-beta
2个回答
0
投票

而是通过故事板中的导航控制器设置左侧栏按钮图像。

单击Storyboard中的导航控制器并确保选中导航栏。

Click on your Navigation Controller in Storyboard and ensure Navigation Bar is selected

选择背面和背面蒙版的图像。

Choose your back button image for both Back and Back mask


0
投票

它可以通过“降低图像的分辨率”适合导航栏按钮的左侧。

© www.soinside.com 2019 - 2024. All rights reserved.