Show preview in Android Studio in preview

I don’t want to programmatically display visibility, and I do it in xml files, but when I set the visibility property to GONE view hides from the preview screen. Sometimes I need to correct some fields in the views I have viewed, and I have to change the visibility to VISIBILITY, make changes and change the visibility. This is annoying.

How to make a view with GONE visibility visible ONLY in Android Studio preview.

+4
source share
1 answer

There is a really easy way to do this:

  • Define the attribute toolsin the main layout:

    xmlns:tools="http://schemas.android.com/tools"
    
  • , , :

    tools:visibility="visible"
    
+7

Source: https://habr.com/ru/post/1527547/


All Articles