问题
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
来源:https://stackoverflow.com/questions/25111910/difference-between-androidwidgetlayout-and-androidlayout-for-preference