Guest User

Untitled

a guest
Jul 19th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. style="android:galleryItemBackground"
  2.  
  3. <Gallery style="android:galleryItemBackground"
  4. android:id="@+id/gallery"
  5. android:layout_width="fill_parent"
  6. android:layout_height="fill_parent"
  7. android:layout_gravity="top" android:layout_marginTop="50dip"/>
  8.  
  9. gallery.setUnselectedAlpha(0.3f);
  10.  
  11. public View getView(int position, View convertView, ViewGroup parent) {
  12. ImageView i = new ImageView(mContext);
  13.  
  14. position= getPosition(position);
  15.  
  16. i.setImageBitmap(images.elementAt(position));
  17. i.setScaleType(ImageView.ScaleType.FIT_CENTER);
  18.  
  19. i.setBackgroundColor(R.color.chatblue); //add some background, and it work!
  20.  
  21.  
  22. return i;
  23. }
Add Comment
Please, Sign In to add comment