[英]android I can't fill the screen with my content
我真的不明白如何處理不同的手機/平板電腦屏幕。 我參考檢索google nexus的屏幕看起來很完美(800x480)但特別是平板電腦看起來很糟糕。 在左角1/4大小。 屏幕的剩余部分只是垃圾。
我在xml上做的是這樣的;
<LinearLayout>
<RelativeLayout fill_parent>
<LinearLayout height="fill_parent" width="387dp">
RIGHT SCREEN
</LinearLayout>
<LinearLayout height="fill_parent" marginLeft="387dp" width="147dp">
LEFT SCREEN
</LinearLayout>
</RelativeLayout>
</LinearLayout>
您應該在Manifest文件中包含對xlarge屏幕的支持。 您還可以為xlarge屏幕設計單獨的布局。 看看這篇文章
你可以有:
<?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">
<LinearLayout
android:id="@+id/left"
android:layout_weight="1"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
</LinearLayout>
<LinearLayout
android:id="@+id/right"
android:layout_weight="2"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
</LinearLayout>
</LinearLayout>
您也可以使用RelativeLayout。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.