我怎样才能建立在Android的垂直画廊?画廊、Android

2023-09-05 10:06:25 作者:孤毒

我想创建一个小部件,其行为类似于库组件,但是垂直滚动,而不是水平。这是在画廊图像应垂直放置在屏幕上,并可以滚动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>
 
精彩推荐
图片推荐