我有一個LinearLayout與另一個Linearlayout裏面。在第二個LinearLayout中,我有3個ImageViews,但它們都是在圖片中看到的。Android - 圖像並排無拉伸
這裏是我的XML代碼:
<?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="fill_parent"
android:layout_margin="10dp"
android:orientation="vertical" >
<TextView
android:id="@+id/contact_data"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="@drawable/bubble"
android:gravity="center"
android:padding="10sp"
android:text="@string/contact_data"
android:textColor="#000000" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_margin="10dp"
android:background="@android:color/darker_gray" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<ImageView
android:id="@+id/phonenumber"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:background="@drawable/phone"
android:clickable="true"
android:onClick="onClick" />
<ImageView
android:id="@+id/emailaddress"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:background="@drawable/email"
android:clickable="true"
android:onClick="onClick" />
<ImageView
android:id="@+id/internetaddress"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:background="@drawable/internet"
android:clickable="true"
android:onClick="onClick" />
</LinearLayout>
</LinearLayout>
什麼問題? PS:我有3種尺寸的每張圖片:32x32的drawable-ldpi,48x48的drawable-mdpi和64x64的drawable-hdpi。
將scaleType更改爲CenterCrop –
它不會更改任何內容 –