마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

스크롤 뷰 화면에 출력하기

0 추천

책을 보고 따라해보고잇는 초보자인데요

하다가 잘몰르는 부분이 잇어서 글을 올려봅니다 

제가 소스를 잇는 그대로 쳐서 스크롤 생성시킨 부분 태그안에다가 집어 넣어봣는데요 

결과창을 확인해보니 책이랑은 다른모습이더군요 

왜그런지 잘이해가 안되는데요 

설명좀 해주시면 감사하겟습니다

코드는 이렇게 생겻습니다

<?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" >
 
    <ScrollView
        android:id="+id/test_scroll_view1"
        android:layout_width="fill_parent"
        android:layout_heigh="fill_parent" >
 
        <LinearLayout
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout:orientation="vertical"
            android:paaddingRight="5pt" >
 
            <TextView
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:text="@string/text_view_string1"
                android:textSize="320px"
                android:textStyle="bold" />
 
            <TextView
                android:layout_width="fill_parent"
                android:layut_height="wrap_contetn"
                android:text="@string/text_view_string1"
                android:textSize="320px"
                android:textStyle="bold" />
 
            <TextView
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:text="@string/text_view_string1"
                android:textSize="320px"
                android:textStyle="bold" />
        </LinearLayout>
    </ScrollView>
 
    <ScrollView
        android:id="@+id/scrollView1"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="0.89" >
 
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical" >
        </LinearLayout>
    </ScrollView>
 
</LinearLayout>

 

잘될거야 (140 포인트) 님이 2014년 6월 5일 질문

1개의 답변

0 추천
일단 xlmns:android어쩌구 하는거 두번째 리니어 레이아웃에는 빼보시고..책은 어떻게 나온답니까?
YeonMin (17,860 포인트) 님이 2014년 6월 5일 답변
<ScrollView android:id="+id/test_scroll_view1"
android:layout_width="fill_parent"
android:layout_heigh="fill_parent">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout:orientation="vertical"
    android:paaddingRight="5pt">
    <TextView
        android:textSize="320px"
        android:textStyle="bold"
        android:text="@string/text_view_string1"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"/>
    <TextView
        android:textSize="320px"
        android:textStyle="bold"
        android:text="@string/text_view_string1"
        android:layout_width="fill_parent"
        android:layut_height="wrap_contetn"/>
    <TextView
        android:textSize="320px"
        android:textStyle="bold"
        android:text="@string/text_view_string1"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"/>
</LinearLayout>
</ScrollView>
이렇게 넣으라고 나오는데요
태그안에 넣기만해도 화면크기가 맞춰 자동으로 내용이 스크롤 된다네요
그리고 액티비티 자바파일 만들어서 실행을 해보라고 나와잇네요
책내용대로 해보세요~ 리니어 레이아웃 안에 있으면 레이아웃이 잘 안잡힐 수 있습니다..제일 바깥에 리니어를 RelativeLayout으로 바꾸는것도 좋은 방법입니다
...