我是一名初学者。 我正在开发一个应用程序,遇到了布局方面的奇怪问题。
当我在小设备上运行我的应用程序时,它工作正常,但是当我在大屏幕设备上运行它时,它的布局属性会自动更改。
请告诉我是否有任何方法可以为所有屏幕大小创建单个编程布局?
我的xml是:
这里我成功获取了第一张图片,但是第二张图片大小不正确。
<RelativeLayout android:id="@+id/contents"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<ImageButton
android:id="@+id/imgBtn1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:background="@drawable/panchangtab1" />
<ImageButton
android:id="@+id/imgBtn2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_toRightOf="@+id/imgBtn1"
android:background="@drawable/horoscopetab1" />
</RelativeLayout>
这里我成功获取了第一张图片,但是第二张图片大小不正确。