-1
我工作的無線電的應用程序與一個簡單的用戶界面(Y-順序):佈局與重量和最低高度
- 蓋
- 標題+藝術家
- 按鈕播放/暫停/ .. 。
- 迴音璧
但我面臨着屏幕尺寸的問題。
封面需要留在頂部,並保持1:1的比例(如果有空間)。 聲吧停留在底部。
帶軌道信息和播放/暫停按鈕的部分需要調整其自身的大小以佔據剩餘空間並將其中的內容居中。
我通過使用LinearLayout對中間佈局加權1來實現此目的,但在小屏幕上,內容被裁剪爲。
我嘗試多個解決方案(協調員,相對...),但沒有人按預期工作。
當我的內容沒有被裁剪時,它對齊底部而不是居中。
這是我的真正的XML,在正常和大屏幕上按預期工作,但在小屏幕上裁剪出android:id =「@ + id/content」。
<LinearLayout
android:id="@+id/content_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<include
android:id="@+id/layout_cover"
layout="@layout/layout_cover"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:elevation="1dp" />
<LinearLayout
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<include
android:id="@+id/layout_informations"
layout="@layout/layout_informations"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/medium_margin"
android:elevation="2dp" />
<include
android:id="@+id/layout_actionbar"
layout="@layout/layout_actionbar"
android:layout_width="match_parent"
android:layout_height="@dimen/layout_actionbar_height"
android:layout_margin="@dimen/common_margin" />
</LinearLayout>
<include
android:id="@+id/layout_soundbar"
layout="@layout/layout_soundbar"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
非常感謝您的幫助。
的Fab
請發佈輸出截圖 –
http://hpics.li/a318fff –
如果沒有足夠的空間(最初爲1:1),封面(綠色條紋)需要裁剪自己。信息/按鈕部分(綠色括號)需要將其自身置於封面和條形音箱之間的剩餘空間中。 –