简体   繁体   English

无需构建项目即可预览xml布局文件android studio

[英]Preview xml layout file without build project android studio

I have big project in android studio and I can't build it because of lot of error!!!我在 android studio 中有一个大项目,但由于很多错误而无法构建它!!!
I want just see preview of some XML so there is any way to see them without build completed successfully!!我只想查看一些 XML 的预览,因此有任何方法可以在未成功完成构建的情况下查看它们!!
except movie file to another project and see them ..!除了电影文件到另一个项目,看看他们..!

My XML have some custom views.我的 XML 有一些自定义视图。 and custom views class have't any Error!和自定义视图类没有任何错误!

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="40dp">

        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentEnd="true"
            android:layout_centerVertical="true"
            android:layout_marginEnd="8dp"
            android:contentDescription="@string/recorder_help"
            android:paddingStart="14dp"
            android:paddingTop="8dp"
            android:paddingEnd="14dp"
            android:paddingBottom="8dp"
            android:src="@drawable/btn_menu_more"
            android:visibility="gone" />

        <ImageView
            android:id="@+id/imgAbout"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentEnd="true"
            android:layout_centerVertical="true"
            android:layout_marginEnd="@dimen/about_margin_right"
            android:contentDescription="@string/about_title"
            android:paddingStart="@dimen/normal_widget_padding"
            android:paddingTop="@dimen/about_padding_top"
            android:paddingEnd="@dimen/normal_widget_padding"
            android:paddingBottom="@dimen/about_padding_top"
            android:src="@drawable/btn_about" />

        <TextView
            android:id="@+id/speech_title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@+id/network_layout"
            android:layout_alignParentStart="true"
            android:gravity="center"
            android:text="@string/record_mode_dictation"
            android:textColor="@color/recorder_text_color"
            android:textSize="@dimen/record_mode_text_size"
            android:visibility="gone" />

        <com.soundrecorder.widget.frequencyview.SoundWave
            android:layout_width="32dp"
            android:layout_height="32dp"
            android:layout_centerVertical="true"
            android:layout_marginStart="10dp"
            android:visibility="invisible" />
    </RelativeLayout>

You can use Udacity visualizer to preview XML layout files.您可以使用Udacity 可视化工具来预览 XML 布局文件。

But not all features are available like Gravity or layoutDirection .但并非所有功能都可用,例如GravitylayoutDirection

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM