결과화면

 

 

 package com.example.containerdemo;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;

public class HScrollViewDemo extends Activity {

 @Override
 protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.hscorllview_demo);
 }
}

 <HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".MainActivity" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="horizontal" >

        <TextView
            android:layout_width="200dip"
            android:layout_height="match_parent"
            android:background="#0000ff"
            android:gravity="center"
            android:text="@string/hello_world" />

        <TextView
            android:layout_width="300dip"
            android:layout_height="match_parent"
            android:background="#00ff00"
            android:gravity="center"
            android:text="@string/hello_world" />

        <TextView
            android:layout_width="400dip"
            android:layout_height="match_parent"
            android:background="#ff0000"
            android:gravity="center"
            android:text="@string/hello_world" />
    </LinearLayout>

</HorizontalScrollView>

 

'2020년도 이전 > [WebSig] Android' 카테고리의 다른 글

ListView Demo2 - extends ListActivity 이용...  (0) 2013.08.14
ListView Demo1  (0) 2013.08.14
SeekBar Demo  (0) 2013.08.13
ProgressBar Demo3  (0) 2013.08.13
ProgressBar Demo2 -> 원형 프로그레스 바  (0) 2013.08.13

+ Recent posts