Android Gallery防止抖动
今天在做一个循环滚动的Gallery时当图片为两张的时候一直抖动,最终程序崩溃,这个问题纠结了好久,在stackoverflow中也找了好久,没有什么有效的办法,一般都是设置什么wrapcontent到fillparent的,最后同事的一个程序是好的,请教了一下,居然好了。下面是解决问题的方案:
- <FrameLayout
- android:id="@+id/news_detail_content_layout"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical" >
- <com.hoge.android.wuxiwireless.ui.view.HomeGallery
- android:id="@+id/news_detail_content_gallery"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:animationDuration="100"
- android:background="@drawable/default_bg2"
- android:fadingEdge="none"
- android:spacing="0.0dip" />
- </FrameLayout>
原因不多说了,bug
在你的Gallery外面套上一层FrameLayout