【项目笔记】布局文件报错Suspicious size: this will make the view invisible, probably intended for layout_width

时间:2023-02-02 15:36:03

【项目笔记】布局文件报错Suspicious size: this will make the view invisible, probably intended for layout_width

写着写着就懵逼了,一直以为布局文件没写错啊,horizontal就是竖直啊,原来布局文件报错,不仅仅需要从报错的地方解决问题,还需要从其他地方去分析。

很明显是方向orientation选错了,应该写成vertical 才是竖直方向而不是horizontal

 <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" > <ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
> <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" > <FrameLayout
android:id="@+id/fl_appinfo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="@drawable/list_item_bg_normal" >
</FrameLayout> </LinearLayout>
</ScrollView> <FrameLayout
android:id="@+id/fl_download"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/detail_bottom_bg" >
</FrameLayout> </LinearLayout>