2015-11-16 239 views
0

我有一個ratingBar和一個twoTabList,我想坐,以便ratingBar在twoTabList上方,並且它們都水平佔據整個屏幕。但是,無論何時我嘗試放置其中一個,它都會將其他屏幕切割出來。Android的XML佈局重疊

這裏是我的代碼,現在的.XML:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:padding="1dp" 
    android:background="@color/light_grey" 
    android:layout_below="@id/tabs" 
    android:weightSum="1" 
    android:orientation="horizontal"> 

<RatingBar 
    android:id="@+id/rating" 
    android:layout_width="0dp" 
    android:layout_height="wrap_content" 
    android:clickable="true" 
    android:stepSize="1.0" 
    android:isIndicator="false" 
    android:rating="3" 
    style="@style/Base.Widget.AppCompat.RatingBar" 
    android:numStars="5" 
    android:focusable="false" 
    android:focusableInTouchMode="false" 
    android:layout_weight="144" /> 

<android.support.v7.widget.RecyclerView 
    android:id="@+id/tabTwoList" 
    android:scrollbars="vertical" 
    android:layout_width="match_parent" 
    android:layout_height="444dp" 
    android:layout_weight="116.25"> 
</android.support.v7.widget.RecyclerView> 

</LinearLayout> 

回答

0

試試這個:

android:orientation="vertical" 
+0

嘿感謝您的答覆!這使得android studio的設計輸出顯示它看起來如何我想要它,但是當我運行模擬器時,它顯示頂部的評級欄,然後沿整個垂直方向顯示twoTabList,並在大約一半的水平上切割。有任何想法嗎? – Itheyln

+0

請畫出你想要的設計。我會幫助。 – AndroidLTG