Android spinner dim background

随声附和 提交于 2019-12-11 09:33:24

问题


I have a spinner hidden in my application and I show it when a button is pressed ( performClick... ). What I want is, when the spinner is displayed, to dim the background so focus is on the spinner. Like when an alert dialog is shown where background gets dimmed. I didn't find anything in the Spinner Documentation. Any suggestions?


回答1:


You can place a full layout view with white or black background between the spinner and other elements and animate its alpha in/out when the spinner appears/disappears. At the end of "out" animation you need to set it's visibility to View.GONE to disallow it to gather user's clicks.



来源:https://stackoverflow.com/questions/23405177/android-spinner-dim-background

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!