为Android创建单一弹性/液体布局屏幕
是否可以在为Android创建单一弹性/液体布局屏幕,android,resize,liquid-layout,elasticlayout,Android,Resize,Liquid Layout,Elasticlayout,是否可以在Android上创建一个liquid/elastic屏幕布局,以适应所有屏幕大小 目前,我正在为小型、中型、大型、xlarge等应用不同的布局,但我真正需要的是一个可缩放的单一布局 例如基于百分比的布局。 我正在创建的应用程序并不特别需要利用更大的屏幕来更多地利用空间 主屏幕只有两个图像,一组按钮,底部有一个广告,我只是希望广告保持在底部,而其他一切都会根据屏幕大小相应地放大 为了一个非常简单的界面,必须制作4种不同的布局,这似乎太复杂了 非常感谢您的建议 您可以使用 或 布局与权重类
Android
上创建一个liquid/elastic
屏幕布局,以适应所有屏幕大小
目前,我正在为小型、中型、大型、xlarge等应用不同的布局,但我真正需要的是一个可缩放的单一布局
例如基于百分比的布局。
我正在创建的应用程序并不特别需要利用更大的屏幕来更多地利用空间
主屏幕只有两个图像,一组按钮,底部有一个广告,我只是希望广告保持在底部,而其他一切都会根据屏幕大小相应地放大
为了一个非常简单的界面,必须制作4种不同的布局,这似乎太复杂了
非常感谢您的建议 您可以使用
或
布局与权重类似
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:scaleType="fitXY"
android:src="@drawable/ic_launcher" />
<ImageView
android:id="@+id/imageView2"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:scaleType="fitXY"
android:src="@drawable/ic_launcher" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
<Button
android:id="@+id/button3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
</LinearLayout>
</LinearLayout>
<TextView
android:id="@+id/textView1"
android:layout_width="match_parent"
android:layout_height="70dp"
android:gravity="center"
android:text="ADV" />
</LinearLayout>
。我认为不可能只添加布局截图,这样我就可以帮助您进行布局。下面是我们想要使用的布局模型