IliaEremin
IliaEremin

Reputation: 3397

Show gone view in Android Studio in preview

I don't want set visibility programmatically and I make it in xml files, but when I set visibility property to GONE view hides from preview screen. Sometimes I need to correct some field in gone views and I must change visibility to VISIBLE, make changes and change visibility back. It's annoying.

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

Upvotes: 6

Views: 1220

Answers (1)

halpsb
halpsb

Reputation: 1106

There is indeed a simple way to do that:

  • Define the tools attribute in your main Layout:

    xmlns:tools="http://schemas.android.com/tools"
    
  • Use it to make your element visible, like you normally would:

    tools:visibility="visible"
    

Upvotes: 11

Related Questions