我在Eclipse上使用Android開發非常新。Android - ImageView Image Boundaries Bidder then Image
我正在做一個基本的相對佈局,並有一個標題,歡迎信息,圖像,最終文本。在肖像模式下。
圖像似乎是問題所在。當我在2.7英寸的屏幕上時,視圖範圍擴展到左側和右側,這是沒有問題的,但如果我移動到7「或10」視圖,圖像邊界會上下延伸,從而推動文本在頂部,與底部了。所以,現在有白色的空間相當大的份額。
http://imgur.com/GeM4psS這是圖像時,在7-10" 肖像(見藍色邊界推文遠)
http://imgur.com/16JCtSy這是2.7英寸時的圖像,現在綁定推到左側和右側,但不會引起任何問題。
最佳情況下,我希望圖像始終處於這些範圍內。 XML參與其中。沒有Java被改變。感謝任何幫助。謝謝。如果我改變它以適合它伸展圖像,就擡起頭來。
<RelativeLayout xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="cs.play.quotably.MainActivity" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:text="@string/app_name"
android:textSize="30sp" />
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@id/textView3"
android:layout_below="@id/textView2"
android:layout_centerHorizontal="true"
android:layout_marginTop="8dp"
android:adjustViewBounds="true"
android:contentDescription="@string/fdr"
android:scaleType="fitCenter"
android:src="@drawable/fdr" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/textView1"
android:layout_centerHorizontal="true"
android:layout_marginTop="8dp"
android:gravity="center"
android:text="@string/welcome"
android:textSize="15sp" />
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="8dp"
android:gravity="center"
android:text="@string/quote1"
android:textSize="15sp" />
</RelativeLayout>
感謝您的任何和所有幫助!