【項目筆記】布局文件報錯Suspicious size: this will make the view invisible, probably intended for layout_width


寫着寫着就懵逼了,一直以為布局文件沒寫錯啊,horizontal就是豎直啊,原來布局文件報錯,不僅僅需要從報錯的地方解決問題,還需要從其他地方去分析。

很明顯是方向orientation選錯了,應該寫成vertical 才是豎直方向而不是horizontal

 1 <?xml version="1.0" encoding="utf-8"?>
 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 3     android:layout_width="match_parent"
 4     android:layout_height="match_parent"
 5  android:orientation="vertical" >
 6 
 7 
 8         <ScrollView
 9             android:layout_width="match_parent"
10  android:layout_height="0dp"
11  android:layout_weight="1" >
12 
13             <LinearLayout
14                 android:layout_width="match_parent"
15                 android:layout_height="wrap_content"
16                 android:orientation="vertical" >
17 
18                 <FrameLayout
19                     android:id="@+id/fl_appinfo"
20                     android:layout_width="match_parent"
21                     android:layout_height="wrap_content"
22                     android:layout_marginLeft="5dp"
23                     android:layout_marginRight="5dp"
24                     android:background="@drawable/list_item_bg_normal" >
25                 </FrameLayout>
26 
27             </LinearLayout>
28         </ScrollView>
29 
30     <FrameLayout
31         android:id="@+id/fl_download"
32         android:layout_width="match_parent"
33         android:layout_height="wrap_content"
34         android:background="@drawable/detail_bottom_bg" >
35     </FrameLayout>
36 
37 </LinearLayout>

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM