Android – How to make a imageView full the screen?

在layout檔的屬性中加入

<ImageView
        android:id="@+id/trialIntervalImage"
        android:layout_width="2000dp"
        android:layout_height="1500dp"
        android:scaleType="fitXY"  //這行
        android:src="@drawable/trialintervalimage"
/>

android:scaleType=”fitXY” 會讓原圖滿版到整個螢幕

 

參考:

1.农民伯伯 Android2.2 API 中文文档系列(6) —— ImageView:

http://www.cnblogs.com/over140/archive/2010/09/19/1830703.html

作者

RongSon

Graduate Student of CCU COMM Game Development, Network Communication, macOS/Ubuntu/Android, Arduino/Raspberry Pi/Intel Edison, Java/Python/C/C++

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *