Android - How to programmatically set the button style in a Linearlayout?

前端 未结 6 1821
无人共我
无人共我 2020-12-25 11:22

I am programmatically creating a LinearLayout for an AlertDialog with some buttons.

I WANT to do this:



        
6条回答
  •  心在旅途
    2020-12-25 11:44

    Hope I'm not too late to join the party :)

    Well, Styles can be applied to a View at initialization phase. For example:

    LinearLayout button = new LinearLayout(context, null, android.R.style.ButtonBar);
    

提交回复
热议问题