Difference between android:widgetLayout and androi

2019-06-27 01:17发布

问题:

I'm getting some weird configuration where widgetLayout configures the inner space of a list item and layout configures the whole item list and the screen background? Can someone actually explain what is the widgetLayout?

回答1:

android:layout: The layout for the entire Preference (include title, summary and widget)

android:widgetLayout: The layout for the controllable widget portion of a Preference (e.g. a checkbox preference would specify a custom layout consisting of just the CheckBox here)

https://code.luasoftware.com/tutorials/android/override-layout-of-android-preference/



回答2:

android:widgetLayout

The layout for the controllable widget portion of a Preference. This is inflated into the layout for a Preference and should be used more frequently than the layout attribute. For example, a checkbox preference would specify a custom layout (consisting of just the CheckBox) here.

Check this link for more Explanation