开发者

how do i change the layout of preferences screen in android

i have a preferences screen , and i wa开发者_高级运维nt to add a button, imageview etc all in a relative layout within the preferences screen.How do i do it? The preferences screen has 3 checkboxpreferences.

thank you in advance.


The best idea is to extend the Preference class, and use setWidgetLayoutResource on the constructor for your RelativeLayout. The widgetLayout is the area to the left of the title and summary. If you want to change the whole preference, you need to use setLayoutResource. In this case there are some restrictions:

This layout should contain a ViewGroup with ID widget_frame to be the parent of the specific widget for this Preference. It should similarly contain title and summary.

Source: http://developer.android.com/reference/android/preference/Preference.html#setLayoutResource(int)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜