Custom spinner dialog for Android

余生长醉 提交于 2019-12-10 08:31:25

问题


How do I do a custom theme android spinner dialog?


回答1:


This blog has an example that probably covers your question:

http://www.mokasocial.com/2011/03/easily-create-a-default-custom-styled-spinner-android/


Edit:

These blog posts has a pretty similar answer: http://karanbalkar.com/2013/07/tutorial-39-create-custom-spinner-in-android/ http://stephenpengilley.blogspot.no/2013/01/android-custom-spinner-tutorial.html

The key to customizing an Android Spinner is to create a custom resource for the spinner rows, and then passing that row layout into a custom adapter. In the custom adapter, one can override the following two functions:

@Override
public View getDropDownView(int position, View cnvtView, ViewGroup prnt) {
    // Custom view generation       
}


@Override
public View getView(int pos, View cnvtView, ViewGroup prnt) {
    // Custom view generation
}

To determine how the Android Spinner will look to the user.



来源:https://stackoverflow.com/questions/4934136/custom-spinner-dialog-for-android

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