开发者

Android set style in constructor

开发者 https://www.devze.com 2023-03-21 12:01 出处:网络
I am creating UI dynamically in my code. I know it\'s impossible to switch between styles via code at runtime, but how can I a开发者_开发百科ssign the style while creating object?

I am creating UI dynamically in my code. I know it's impossible to switch between styles via code at runtime, but how can I a开发者_开发百科ssign the style while creating object?

I want to use something like:

 ListView listView = new ListView(this, null, R.style.listViewStyle);

Thanks.


Seems like it's not possible. The closest solution is to create an XML file describing the ListView and then just inflate a View.

0

精彩评论

暂无评论...
验证码 换一张
取 消