我不知道为什么,但此行错误:`UITextField.appearance()tintColor`改变`rightBarButtonItem`颜色
UITextField.appearance().tintColor = Colors.orange
让我rightBarButtonItem
蓝......(它也设置成橙色代码中的其他地方)。
我没有确认评论该行使rightBarButtonItem
桔子如我所料。
任何想法可能是错误的?
我不知道为什么,但此行错误:`UITextField.appearance()tintColor`改变`rightBarButtonItem`颜色
UITextField.appearance().tintColor = Colors.orange
让我rightBarButtonItem
蓝......(它也设置成橙色代码中的其他地方)。
我没有确认评论该行使rightBarButtonItem
桔子如我所料。
任何想法可能是错误的?
寻找你的代码很难找到答案。但您可以尝试其他方法,在viewcontroller
内使用属性检查器添加navigation item
,然后在右侧添加barbuttonitem
,并在其中添加button
,然后根据需要更改颜色。
其余的代码是故事板,右边带有图片。我还应该分享哪些其他内容以使问题更清楚? –
顺便说一句,我认为在UIBarButtonItem中添加一个UIButton可能会起作用,因为左边的按钮是这样设置的,颜色没有改变。但是,另一种方式也应该起作用,“UITextField”外观与这些之一有什么关系? –
是的,我会接受你的答案,因为它确实奏效,谢谢,但我仍然想知道为什么其他方式不行。 –
关注评论downvote? –
你的问题非常含糊,没有代码或上下文。人们不能对这样的问题进行推理,因而会使其失望。 –
我不确定缺少的是什么,在导航栏上的'UITextField.appearance()。tintColor = Colors.orange'右边的行是蓝色的,没有它,它是图像的颜色。 –