在我的应用程序中,我想放置一个 .png 文件,我希望它在横向和纵向模式下都被视为滚动图像,请推荐代码或示例....
最佳答案
要使您的 Imageview 在高度不适合时滚动,您可以在 xml 中的 ScrollView 中添加一个 ImageView,并添加此参数 -
android:adjustViewBounds="true"
这是一个例子-
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<ImageView
android:id="@+id/imageView2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:background="@drawable/back" >
</ImageView>
</ScrollView>
关于java - android 中 ScrollView 中的图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4990682/