아래 소스 코드가 있는 데요
에러가 자꾸 나네요 ( scrollview can host only one direct child )
어디 부분이 에러인지좀 알아봐주실수 잇나요 .....ㅜㅜ
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:id="@+id/TT_Topmenu"
android:layout_width="wrap_content"
android:layout_height="65px"
android:orientation="horizontal">
<Button
android:background="@drawable/btn_back"
android:layout_width="100px"
android:layout_height="65px"
android:id="@+id/TT_Back">
</Button>
</LinearLayout>
<ScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/TT_bkimg">
<Button
android:background="@drawable/btn_blog"
android:layout_width="534px"
android:layout_height="12px"
android:id="@+id/TT_Blog">
</Button>
</ScrollView>
</LinearLayout>
</LinearLayout>
ScrollView 는 하나의 자식 뷰만 소유할 수 있습니다.
만일 여러 개의 자식 뷰를 포함하고 싶다면,
ScrollView 안에는 하나의 Layout 뷰만을 포함하고,
Layout 뷰에 여러 개의 자식 뷰를 포함할 수는 있습니다.
그러면
<ScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/TT_bkimg">
//여기에 linearlayout 을 추가하면 된다는건가요???????????
<Button
android:background="@drawable/btn_blog"
android:layout_width="534px"
android:layout_height="12px"
android:id="@+id/TT_Blog">
</Button>
</ScrollView>
<ScrollView>
<LinearLayout>
<Button />
<ImageView />
</LinearLayout>
</ScrollView>
와 같은 형태가 되겠죠




setContentView(R.layout.todaytip);
ScrollView vBack = (ScrollView) findViewById(R.id.TT_bkimg);
vBack.addView(new ColorView(this));
이건 자바에서 코딩한 내용입니다....