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

前端 未结 6 1803
无人共我
无人共我 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:30

    The Paris library from AirBnB is perfect for this, allowing for programmatic configuration like so:

    Paris.styleBuilder(textView)
            .add(R.style.MyGreenTextView)
            .textSizeRes(R.dimen.my_text_size_small)
            .apply();
    

提交回复
热议问题