我怎样才能建立在Android的垂直画廊? [英] How I can create vertical gallery in Android?

查看:388
本文介绍了我怎样才能建立在Android的垂直画廊?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个小部件,其行为类似于库组件,但是垂直滚动,而不是水平。这是在画廊图像应垂直放置在屏幕上,并可以滚动vertically.Does有人帮帮我好吗?

I want to create a widget that behaves similar to the gallery widget but scrolls vertically instead of horizontally. That is images in gallery should be vertically placed on screen and can be scroll vertically.Does anybody help me please?

推荐答案

假设你想有图像中的一列,并希望垂直滚动。请检查下面的例子

Assume that you want to have a single column of images and want to scroll vertically. Check the following example

   <GridView android:id="@+id/gridView1" 
    android:layout_width="70dp"  android:layout_height="fill_parent"
    android:verticalSpacing="2dp"   android:numColumns="1" 
    android:stretchMode="columnWidth" android:layout_marginLeft="1dp"
    android:layout_alignParentTop="true"  android:scrollingCache="true"
    android:scrollbars="vertical" android:fadeScrollbars="false"
    android:scrollbarAlwaysDrawVerticalTrack="true">
</GridView>

这篇关于我怎样才能建立在Android的垂直画廊?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆