开发者

How to Update an Xml File Android?

开发者 https://www.devze.com 2023-03-09 14:19 出处:网络
I have a layout where users can add buttons and place them where they want. I want to allow the user to save their layout so that it is loaded t开发者_开发知识库he next time they open the app. so can

I have a layout where users can add buttons and place them where they want. I want to allow the user to save their layout so that it is loaded t开发者_开发知识库he next time they open the app. so can i save the updated xml file ?


you will need to Create layout at rumTime , because you can't edit anything into your xml . all you have is its resource reference R.layout.layout_name ;

So after creating layout RumTime , let your user redesign it....and save new coordinates/settings into persistent storage like shared preference or database/file . when later you when need updated layout pick these settings up and use them .

0

精彩评论

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

关注公众号