我想顯示的是image
這是比屏幕更長的。我在scroll view
內使用ImageView
。我得到一個白屏,這是滾動到image
的height
,但圖像本身沒有提出。Android ImageView在ScrollView中顯示白色屏幕
下面是我使用佈局的xml: -
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/scrollView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:fillViewport="true"
tools:context=".MainActivity" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:contentDescription="@string/test_image_content_description"
android:adjustViewBounds="true"
android:visibility="visible"
android:src="@drawable/test_image" />
</ScrollView>
test_image.png是一個文件,該文件是在應用的所有 「drawable
」 文件夾中找到。
任何幫助將不勝感激!
它是否在您的圖形佈局顯示? –
嗨,是的。它在圖形佈局中可見,因爲我希望它在實際運行時看起來像。 – dcoder