2012年6月6日 星期三

奇科電腦 Android水平捲動方法


ScrollView適用垂直捲動
HorizontalScrollView適用水平捲動

<?xml version="1.0" encoding="utf-8"?>

<HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent">

<RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/test">

<Button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:layout_marginLeft="120dp" android:layout_marginTop="134dp" android:text="Button" />

</RelativeLayout>

</HorizontalScrollView>

<更多技術小秘訣請看 http://www.geego.com.tw/tech_support/new-tips>

沒有留言:

張貼留言