[ScrollBar3.java]
public class ScrollBar3 extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.scrollbar3);
findViewById(R.id.view3).setScrollBarStyle(View.SCROLLBARS_INSIDE_INSET);
}
}
[scrollbar3.xml]
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ScrollView
android:layout_width="100dip"
android:layout_height="120dip"
android:background="#FF0000">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/scrollbar_2_text" />
.
.
.
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/scrollbar_2_text" />
</LinearLayout>
</ScrollView>
<ScrollView
android:layout_width="100dip"
android:layout_height="120dip"
android:background="#00FF00"
android:paddingRight="12dip">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/scrollbar_3_text"
android:textColor="#000000"
android:background="#60AA60" />
</ScrollView>
<ScrollView
android:id="@+id/view3"
android:layout_width="100dip"
android:layout_height="120dip"
android:background="@android:drawable/edit_text">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textColor="#000000"
android:text="@string/scrollbar_3_text" />
</ScrollView>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<ScrollView
android:id="@+id/view4"
android:layout_width="100dip"
android:layout_height="120dip"
android:scrollbarStyle="outsideOverlay"
android:background="@android:drawable/edit_text">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textColor="#000000"
android:text="@string/scrollbar_3_text" />
</ScrollView>
<ScrollView
android:id="@+id/view5"
android:layout_width="100dip"
android:layout_height="120dip"
android:scrollbarStyle="outsideInset"
android:background="@android:drawable/edit_text">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textColor="#000000"
android:text="@string/scrollbar_3_text" />
</ScrollView>
</LinearLayout>
</LinearLayout>
'old > API_Demo' 카테고리의 다른 글
VIews_SeekBar (0) | 2010.05.06 |
---|---|
Views_Spinner (0) | 2010.05.06 |
Views_ScrollBars_Fancy (0) | 2010.05.06 |
Views_ScrollBars_Basic (0) | 2010.05.06 |
Views_RatingBar (0) | 2010.05.06 |