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

EditText 박스선택시 하단 버튼이 올라오는 방법...

0 추천

에디트 택스트를 선택하면 키패드가 올라올때 하단에 배치해놓은 버튼들도 같이 올라오도록 하는 방법을 찾고있습니다.

매니페스트에 android:windowSoftInputMode="adjustPan" 코드도 추가해봤구요(하단에 배치한 버튼들은 안올라오더라구요)

인터넷에 돌아다니는 아래와 같은 예제도 참고해서 해봤는데 되질않네요 혹시 다른 방법 아시는분 있으시면 도움좀 주세요

 <EditText
        android:id="@+id/viewarea"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:ems="10"
        android:gravity="top|center_vertical"
        android:hint="type here."
        android:maxHeight="0dip"
        android:scrollHorizontally="true"
        android:scrollbars="vertical"
        android:textColor="#FFFFFF" >
 
        <requestFocus />
    </EditText>
 
    <HorizontalScrollView
        android:id="@+id/horizontalScrollView1"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:scrollbars="none" >
</  HorizontalScrollView>
inpee (140 포인트) 님이 2014년 5월 20일 질문

1개의 답변

0 추천
스크롤뷰 사용하시면 간단히 해결됩니다. 메니페스트나 자바코드는 건드리지 않았습니다.
 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.example.test_softkey.MainActivity$PlaceholderFragment" >
 
    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >
 
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content" >
 
            <EditText
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/hello_world" />
        </LinearLayout>
    </ScrollView>
 
    <Button
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:text="@string/app_name" />
 
</RelativeLayout>
여룽이 (4,750 포인트) 님이 2014년 5월 20일 답변
...