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

在编写布局文件时遇到错误'Suspicious size',导致视图不可见。问题源于将orientation误设为horizontal,实际上应设置为vertical以实现竖直布局。通过深入分析并纠正此错误,成功解决了布局显示问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

写着写着就懵逼了,一直以为布局文件没写错啊,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="<span style="font-family:verdana, Arial, Helvetica, sans-serif;color:#333333;"><span style="font-size: 14px; line-height: 25.2px;">vertical</span></span>" >


        <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>


评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值