reusable UI in android app

孤街醉人 提交于 2020-03-05 04:08:43

问题


I am working on android app where I am thinking to develop reusable UI interface. How it can be developed and included in my .xml's

Here I want to develop a progress bar with my image and it will be display on some .xml's. Please provide any code help.

I am a new in this field.


回答1:


you can use <Include> xml tag within your layout xml,

read this :) http://developer.android.com/resources/articles/layout-tricks-merge.html




回答2:


I think you need to use styles and themes. Check this out.




回答3:


You can either build custom (compound) views, look at Building Custom Components. Or you can use Fragments. Fragments are new in Honeycomb (Android 3.0), but there is a compatibility library that adds fragment support to lower android versions (can be found in your ANDROID_SDK/extras/android folder). Or you can mix both of course.



来源:https://stackoverflow.com/questions/7106625/reusable-ui-in-android-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!