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