How to Android Holo Theme style dialog box buttons

后端 未结 3 691
误落风尘
误落风尘 2021-01-29 18:33

I\'m creating a Dialog Box on Holo Theme and want to follow the OS default way of displaying the buttons. So far I have created the dialog box but the buttons don\'t render in t

3条回答
  •  悲&欢浪女
    2021-01-29 18:56

    You can set the theme through the Android Manifest xml or inside the Activity's onCreate with setTheme(android.R.style.Theme_Holo);

    The buttons size is not related to the theme itself. The size is up to your xml definitions. In the image you sent, it seems that the buttons received the Holo theme so there's nothing wrong here...

    Here's an xml layout that will stretch the buttons to fill the whole dialog width:

    
    
        
                    

提交回复
热议问题