创建“突出显示"对“信息暗"有类似效果白色背景上的按钮 [英] Creating "highlight" like effect on "info dark" button on white background

查看:80
本文介绍了创建“突出显示"对“信息暗"有类似效果白色背景上的按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我在深色背景的屏幕左下角放置一个信息灯"按钮,然后选中在高光下显示触摸",则当用户触摸图标时,我会得到很好的突出显示效果.它为用户提供了积极的反馈.

If I put a "info light" button in the lower corner of my screen on dark background and check "Shows Touch On Hightlight", I get a nice highlight effect when the user touches the icon. It gives the user positive feedback.

在我的应用中,背景为白色.所以我选择了信息暗"按钮.选中在高亮显示时显示"和突出显示调整图像".但是由于背景是白色,所以高光效果不可见,用户也无法获得任何反馈.

In my app the background it white. So I selected "info dark" button. The "Shows Touch On Highlight" and "Highlighted Adjusts Image" are checked. But because the background is white, the highlight effect is not visible and the user does not get any feedback.

在触摸信息按钮后,如何创建类似高光/低光的效果以给使用提供一些反馈?

How can I create some kind of highlight/lowlight like effect to give some feedback to the use then the info button is touched?

推荐答案

更新:我已经弄清楚了.创建一个名为infoDarkHighlighted.png的带有暗光的新图像,然后在ViewController的viewDidLoad方法中设置以下内容.

Update: I have figured it out. Create a new image with dark glow called infoDarkHighlighted.png and set the following in the ViewController's viewDidLoad mothod.

[infoButton setImage:[UIImage imageNamed:@"infoDarkHighlighted.png"] forState:UIControlStateHighlighted];

[infoButton setImage:[UIImage imageNamed:@"infoDarkHighlighted.png"] forState:UIControlStateHighlighted];

这篇关于创建“突出显示"对“信息暗"有类似效果白色背景上的按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆