簡體   English   中英

如何在Android應用程序中為不同的主題設置不同的可繪制圖像?

[英]How can you set different drawable images, for different themes in an android application?

如何在Android應用程序中為不同的主題設置不同的可繪制圖像?

您可以通過使用動態結構來實現它,其中所有設計信息都將來自服務器

 1.for that you have to create a xml having list of themes what names you required to give associated with an id.
 2.parse xml and show its content to a list then at selection of an item of list save id associated with it in your shared preferences.
 3.each time when the designing part will be loaded you will send id with it as http://xyz.abc.com/images/menu-images/your_id which will respond you with an image or design info related to that theme id
 4.to save downloading each time of content indroduce a check that if value saved in preferences then use existing image saved or cached in application
 5.Or in case you want to ship images with your applicatio just hardcode the tag the theme id with the image name at run time check selected theme and show the theme related images
   hope this idea will help you.

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM