Android Gallery fullscreen

谁都会走 提交于 2019-12-19 06:57:16

问题


How do I implement a fullscreen gallery? i.e. image stretches to fill all the screen?


回答1:


To make it fullscreen:

        <activity android:name="YourActivity" 
        android:theme="@android:style/Theme.NoTitleBar.Fullscreen">

To make the images fill the screen you should do it on your adapter, creating a View with MATCH_PARENT x MATCH_PARENT and in your ImageView you created on getView you should make it fill all the space:

yourImageView.setScaleType(ImageView.ScaleType.FIT_XY);



回答2:


Use this in Activity Manifest.xml

give property like this

 android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"

Thanks.



来源:https://stackoverflow.com/questions/5312909/android-gallery-fullscreen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!