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

EditText가 키보드에 가려져 scroll를 만들고 싶습니다

0 추천
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".MainActivity" >
    
    
    
    <EditText
        android:id="@+id/editText2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignLeft="@+id/editText1"
        android:layout_alignTop="@+id/editText1"
        android:layout_marginTop="39dp"
        android:ems="10" 
        android:inputType="textPassword"
        android:hint="비밀번호"/> 
    
    <EditText
        android:id="@+id/editText1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true"
        android:layout_marginBottom="82dp"
        android:layout_marginLeft="20dp"
        android:ems="10" 
        android:hint="아이디">

        <requestFocus />
    </EditText>

    
    
    <Button
        android:id="@+id/button1"
        style="?android:attr/buttonStyleSmall"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignBottom="@+id/editText2"
        android:layout_alignTop="@+id/editText1"
        android:layout_toRightOf="@+id/editText2"
        android:onClick="login"
        android:text="로그인" />

    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        android:src="@drawable/car" />

    <TextView
        android:id="@+id/textView1"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_above="@+id/imageView1"
        android:gravity="center"
        android:text="Smart Driver License"
        android:textColor="#000080"
        android:textSize="40sp" />

    <CheckBox
        android:id="@+id/checkBox1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignLeft="@+id/editText2"
        android:layout_below="@+id/editText2"
        android:text="아이디 저장" />

    <CheckBox
        android:id="@+id/checkBox2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignBaseline="@+id/checkBox1"
        android:layout_alignBottom="@+id/checkBox1"
        android:layout_alignRight="@+id/button1"
        android:text="비밀번호 저장" />

</RelativeLayout

 

로그인을 하기위해 아이디를 쓴 후 비밀번호를 쓰려면 키보드때문에 뒤로가기를 눌러 키보드를 없앤 후

비밀번호를 써야되서 그 불편함을 눌일려고  스크롤을 만들려 찾아보니

 <ScrollView
     android:layout_width="fill_parent"
     android:layout_height="fill_parent">

아이디부분

</ScrollView>

를 쓰면 된다기에 이렇게 하니

막 아이디와 비밀번호 적는 edtiText와 사진들 체크박스들이 한 뭉텅이가 되어버리네요..

스크롤도 있고 소스 배열대로 사진과 editText, 체크박스들이 제자리에 있게 하려면

어떻게 해야 될까요?

 

닉넴뭐라하지 (140 포인트) 님이 2013년 11월 10일 질문

답변 달기

· 글에 소스 코드 보기 좋게 넣는 법
· 질문에 대해 추가적인 질문이나 의견이 있으면 답변이 아니라 댓글로 달아주시기 바랍니다.
표시할 이름 (옵션):
개인정보: 당신의 이메일은 이 알림을 보내는데만 사용됩니다.
스팸 차단 검사:
스팸 검사를 다시 받지 않으려면 로그인하거나 혹은 가입 하세요.
...