【发布时间】:2019-02-04 21:16:07
【问题描述】:
根据this discussion,android xml布局文件可以使用工具:parentTag来预览布局使用标签。 我尝试了工具:parentTag,预览为空。 如果我删除 tools:parentTag,预览可以工作,所以我确定是tools:parentTag 使Preview 不能工作。
这是我的布局代码:
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:orientation="vertical"
tools:parentTag="android.widget.LinearLayout">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="hello" />
</merge>
有没有办法解决这个问题?
【问题讨论】: