Preview layout with merge root tag in Intellij IDEA/Android Studio

前端 未结 3 1960
小鲜肉
小鲜肉 2021-01-29 21:26

Let\'s imagine we are developing compound component based on LinearLayout. So, we create class like this:

public class SomeView extends LinearLayout {
    public         


        
3条回答
  •  梦毁少年i
    2021-01-29 22:01

    Edit: Outdated answer. See answer by starkej2.


    Android Studio 0.5.8 added support for tools:showIn. By using it it is possible to preview < merge > layouts.

    http://tools.android.com/recent/androidstudio058released

    layout/layout_merge.xml with tools:showIn:

    
    
    ......
    
    
    

    layout/simple_relativelayout.xml with include:

    
    
        
    
    
    

提交回复
热议问题