Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 999
IlyaEremin Avatar asked Feb 18 '14 15:02

IlyaEremin


People also ask

How to see Live changes in Android Studio?

To turn it on manually, navigate to File > Settings > Editor > Live Edit (Android Studio > Preferences > Editor > Live Edit on a Mac).

How do I open layout editor?

Open an existing layout in Android Studio, and click the Design button in the top-right corner of the editor window. In the Component Tree, right-click the layout, and then click Convert your-layout-type to ConstraintLayout.


1 Answers

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"
    
like image 169
halpsb Avatar answered Oct 23 '22 19:10

halpsb