我佈局的設計同樣是不會在Android Studio中預覽和在運行的應用程序相同:Android的佈局設計不是當應用程序正在運行
設計在運行應用程序
預期設計
這裏的XML文件:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<Button
android:text="Manage messages"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/bt_messages"
android:drawableLeft="@mipmap/ic_message"
android:layout_weight="1" />
<Button
android:text="Manage activities"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/bt_activities"
android:drawableLeft="@mipmap/ic_activities"
android:layout_weight="1" />
</LinearLayout>
</LinearLayout>
你有沒有發生什麼事的想法?
在此先感謝您的幫助
'的android:layout_width = 「0dp」'兩個按鈕 –
是,圖像尺寸是相同的兩個 –
@IntelliJAmiya我想是這樣,我創造了他們在Android剪貼畫,他們在不同大小的5次mimap包中。 我編輯的兩個按鈕的layout_width,沒有任何改變 – Alexandre