2016-09-19 2 views
0

단어로 설명하기가 어렵지만 Google 행 아웃에서 내가 말하는 것을 쉽게 볼 수 있습니다. 아래쪽에있는 EditText를 눌러 주석을 입력하면 EditText의 하단과 소프트 키보드 사이에 몇 개의 버튼이 나타납니다.EditText와 소프트 키보드 사이에 사용자 정의 레이아웃을 추가하는 방법은 무엇입니까?

Google Hangouts EditText with buttons under it

당신은 어떻게해야합니까? 나는 EditText와 그 아래에 Button이있는 간단한 레이아웃을 만들었지 만, 사용자가 EditText를 탭하면, 그 버튼은 소프트 키보드에 의해 가려져있다. 정리 된 샘플은 다음과 같습니다.

<LinearLayout 
    android:orientation="vertical" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_marginTop="@dimen/StandardMarginSmall" 
    android:layout_marginBottom="@dimen/StandardMarginSmall"> 
    <EditText 
     android:id="@+id/NewComment" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:singleLine="false"/> 
    <Button 
     android:id="@+id/PostComment" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:text="@string/Post" 
     /> 
    </LinearLayout> 

편집 모드에서 버튼을 계속 볼 수있게하는 트릭이 있습니까?

답변

2

액티비티에 android:windowSoftInputMode="adjustResize"을 설정하면 소프트 키 보드가 표시 될 때 액티비티 상단에 오버레이되지 않고 액티비티의 내용이 위로 올라갑니다 (크기가 조절됩니다). 그러면 단추를 표시 할 수 있습니다 (활동 레이아웃의 맨 아래에 있습니다).

+0

네, 감사합니다. 나는 EditText 위젯 자체에 대한 옵션이 있다고 생각했지만, 당신 말이 맞습니다. 그것은 Activity Wide 기능입니다. 어느 쪽이든, 나를 위해 일하므로 감사합니다! – Glaucus

관련 문제