IT/Android

android - ProgressBar, SeekBar, RatingBar, ScrollView, SlidingDrawer

노마드오브 2018. 9. 16. 23:02

1. ProgressBar, SeekBar, RatingBar

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<ProgressBar
style="?android:attr/progressBarStyleHorizontal"
android:max="100"
android:progress="20"
android:secondaryProgress="50"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
<SeekBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:progress="20"
/>
<RatingBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:numStars="5"
android:rating="1.5"
android:stepSize="0.5"
/>

</LinearLayout>



2. ScrollView

<?xml version="1.0" encoding="utf-8"?>
<ScrollView
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="fill_parent"
android:orientation="vertical" >

<Button
android:layout_width="match_parent"
android:layout_height="100dp"
android:text="버튼 1"/>
<Button
android:layout_width="match_parent"
android:layout_height="100dp"
android:text="버튼 2"/>
<Button
android:layout_width="match_parent"
android:layout_height="100dp"
android:text="버튼 3"/>
<Button
android:layout_width="match_parent"
android:layout_height="100dp"
android:text="버튼 4"/>
<Button
android:layout_width="match_parent"
android:layout_height="100dp"
android:text="버튼 5"/>
<Button
android:layout_width="match_parent"
android:layout_height="100dp"
android:text="버튼 6"/>
<Button
android:layout_width="match_parent"
android:layout_height="100dp"
android:text="버튼 7"/>
<Button
android:layout_width="match_parent"
android:layout_height="100dp"
android:text="버튼 8"/>
</LinearLayout>

</ScrollView>



3. SlidingDrawer

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="여기는 서랍 밖입니다" />

<SlidingDrawer
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:content="@+id/content"
android:handle="@+id/handle">

<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/handle"
android:text="서랍 손잡이" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/content"
android:background="#00FF00"
android:gravity="center" >

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="여기는 서랍 안입니다" />

</LinearLayout>

</SlidingDrawer>
</LinearLayout>