我有以下布局,在FrameLayout类中夸大了:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="wrap_content">
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/img"
android:layout_gravity="bottom|start"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button"/>
</LinearLayout>
嵌套的LinearLayout与指定的父项不匹配,但将其内容包装为按钮的大小,我还尝试将match父项设置为FrameLayout的高度,
这里可能出什么问题了?
将match_parent用于FrameLayout