开发者

Parsed XML to Layout in Android?

开发者 https://www.devze.com 2023-04-12 18:36 出处:网络
I am working on an application in Android in which I need to design the layout of the application dynamically. I have to get the details of the layout from the database via XML and show the parse resu

I am working on an application in Android in which I need to design the layout of the application dynamically. I have to get the details of the layout from the database via XML and show the parse results on the screen as per the requirement开发者_开发问答. For example, XML will have the number of TextView and Buttons which will be included in the UI.

Can someone please suggest me the possible approach to implement this in Android SDK?

Thanks in Advance, Aagrah


You can create the layout on the fly in Android. Create a Linear/RelativeLayout, then add TextViews and Buttons programatically into it.

See this answer on how to add item programatically.

0

精彩评论

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