Android Gallery防止抖動

Android Gallery防止抖動android

今天在作一個循環滾動的Gallery時當圖片爲兩張的時候一直抖動,最終程序崩潰,這個問題糾結了很久,在stackoverflow中也找了很久,沒有什麼有效的辦法,通常都是設置什麼wrapcontent到fillparent的,最後同事的一個程序是好的,請教了一下,竟然好了。下面是解決問題的方案:less

  
  
  
  
  1. <FrameLayout 
  2.                 android:id="@+id/news_detail_content_layout" 
  3.                 android:layout_width="fill_parent" 
  4.                 android:layout_height="wrap_content" 
  5.                 android:orientation="vertical" > 
  6.  
  7.                 <com.hoge.android.wuxiwireless.ui.view.HomeGallery 
  8.                     android:id="@+id/news_detail_content_gallery" 
  9.                     android:layout_width="fill_parent" 
  10.                     android:layout_height="wrap_content" 
  11.                     android:animationDuration="100" 
  12.                     android:background="@drawable/default_bg2" 
  13.                     android:fadingEdge="none" 
  14.                     android:spacing="0.0dip" /> 
  15.             </FrameLayout> 

緣由很少說了,bugide

在你的Gallery外面套上一層FrameLayoutui

相關文章
相關標籤/搜索