本質上,我正在尋找像scaleType =「centerCrop」之類的東西,而不是中心。ImageView佈局
如果屏幕尺寸大於ImageView
,我無法正確顯示。我試圖顯示一個ImageView
,它開始top=0
,left=0
並且沒有縮放。沒關係,圖像不適合在屏幕上。現在我有它的相對佈局:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/postagram_blank_large"/>
</RelativeLayout>
我的RelativeLayout
高度和寬度使用wrap_content
嘗試。我也玩過scaleType
以及使用Scrollview
。 ScrollView
的問題在於圖像比顯示端口更高更寬(這也是意味着發生)。
我該如何做這項工作?
您是否嘗試過的最高級別的線性佈局?次要音符取向在相對佈局上不做任何事情。 – 2013-02-20 02:05:52
@GabeSechan這並沒有解決問題。並且是的,取向什麼也不做,只是當我替換對LL的嘗試時。 – jjNford 2013-02-20 02:10:41
嘗試強制圖像的比例類型居中 – 2013-02-20 02:12:34