Layout Editor "Design" button missing for v7 PreferenceScreen

271 views Asked by At

Normally when editing a preferences.xml file in Android Studio, one can switch to the layout editor by clicking on the "Design" button at the lower left of the screen:

design button

After clicking the button, the layout editor is shown for this xml file:

enter image description here

But when I change the PreferenceScreen to android.support.v7.preference.PreferenceScreen (as e.g. suggested here), the button disappears (it is necessary to re-open the xml file to see this effect):

enter image description here

  1. Is this behavior normal or is this just my Android Studio installation (v3.1.1 on Windows) - i.e. is the layout editor not yet implemented for v7 preference xml files?
  2. Is it somehow possible to open the layout editor when using v7 preferences anyway? Does a good workaround exist?
  3. It seems that not explicitly declaring the android.support.v7.preference.PreferenceScreen in the xml file does work nevertheless with v7 preferences, so somehow the android.preference.PreferenceScreen gets converted to a android.support.v7.preference.PreferenceScreen behind the scenes. Is there any downside when using v7 preferences and not explicitly declaring android.support.v7.preference.PreferenceScreen in the xml file (so one can still use the layout editor)? What is the difference, if any (other than possible compiler warnings regarding not allowed xml-elements)?
0

There are 0 answers