/*ScrollView_activity.java */
package com.scrollview;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
public class ScrollViewActivity extends
ActionBarActivity {
@Override
protected void onCreate(Bundle
savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_scroll_view);
}
}
/*ScrollView_activity.xml */
<?xml
version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scrollView"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TableLayout
android:id="@+id/tableLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:stretchColumns="0">
<TableRow>
<View
android:background="#565656"
android:layout_height="80px">
</View>
<TextView
android:paddingLeft="4px"
android:text="Abu-Abu"
android:gravity="center_vertical">
</TextView>
</TableRow>
<TableRow>
<View
android:background="#440000"
android:layout_height="80px">
</View>
<TextView
android:paddingLeft="4px"
android:text="Coklat"
android:gravity="center_vertical">
</TextView>
</TableRow>
<TableRow>
<View
android:background="#884400"
android:layout_height="80px">
</View>
<TextView
android:paddingLeft="4px"
android:text="Merah"
android:gravity="center_vertical">
</TextView>
</TableRow>
<TableRow>
<View
android:background="#aa8844"
android:layout_height="80px">
</View>
<TextView
android:paddingLeft="4px"
android:text="Coklat"
android:gravity="center_vertical">
</TextView>
</TableRow>
<TableRow>
<View
android:background="#ffaa88"
android:layout_height="80px">
</View>
<TextView
android:paddingLeft="4px"
android:text="Merah
Marun"
android:gravity="center_vertical">
</TextView>
</TableRow>
<TableRow>
<View
android:background="#ffffaa"
android:layout_height="80px">
</View>
<TextView
android:paddingLeft="4px"
android:text="Kuning"
android:gravity="center_vertical">
</TextView>
</TableRow>
<TableRow>
<View
android:background="#ffffff"
android:layout_height="80px">
</View>
<TextView
android:paddingLeft="4px"
android:text="Putih"
android:gravity="center_vertical">
</TextView>
</TableRow>
</TableLayout>
</ScrollView>
0 comments:
Post a Comment