xml 화면 구성이 마음대로 되지 않아서 죽을 맛이네요...ㅠㅠ
분명 이론상으로는 맞는것 같은데.. 왜 되지 않을까요??
일단 제가 하려는 화면 구성은 다음과 같습니다.
listview1 listview2
button
머 간단한 거죠..
여기서 listview에다가 scrollview를 달아줄겁니다..
각각의 listview를 크기를 지정하여
마치 아이폰에서 picker와 같은 효과를 만들어 주려고 하는데요
어디가 잘못되었는지 모르겠습니다.
분명 liistview의 크기는 가로 : 100px 세로 : 300px 로 설정은 했지만
listview에 들어가는 textview에 따라서 크기가 결정되어 버리는 군요...ㅠㅠ
아래 소스를 적어 놓겠습니다.
먼저 list가 있는 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 xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal"
android:background="#00ff00"
>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#0000ff"
android:scrollbarStyle="insideOverlay"
>
<ListView
android:background="#ffffff"
android:id="@+id/_card_number_list1"
android:layout_marginTop="10dip"
android:cacheColorHint="#00000000"
android:layout_width="100px"
android:layout_height="300px"
android:layout_gravity="center"
android:gravity="center"/>
</ScrollView>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#0000ff"
android:scrollbarStyle="insideOverlay"
>
<ListView
android:background="#ffffff"
android:id="@+id/_card_number_list2"
android:layout_marginTop="10dip"
android:cacheColorHint="#00000000"
android:layout_width="100px"
android:layout_height="300px"
android:layout_gravity="center"
android:gravity="center"/>
</ScrollView>
</LinearLayout>
</LinearLayout>
다음은 listview에 들어가는 textview가 있는 xml 입니다.
<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="6dip" android:orientation="vertical">
<TextView
android:layout_marginTop="10dip"
android:id="@+id/toptext"
android:layout_width="fill_parent"
android:gravity="center_vertical"
android:layout_height="wrap_content"
android:textSize="25px"
android:textColor="#ffffff"
/>
</LinearLayout>




ScrollView 태그 속성을 보시면 android:layout_width="fill_parent" 라고 정의해 주셨네요..
"wrap_content" 값을 주시고 다시 한 번 해보시는건 어떨까요?