0

나는 여기에 독특한 문제가있다. 나는 상대적 레이아웃을 가지고 활동을하며 그것의 자식보기로 텍스트를 편집한다. 또한 자식 레이아웃과 같은 선형 레이아웃이며 선형 레이아웃에는 버튼과 텍스트보기가 포함되어 있습니다. 조금 혼란 스럽지만 나는 명확한 이해와 심지어 나의 활동 XML을위한 스냅 샷을 제공 할 것입니다.편집 텍스트로 디자인 한 안드로이드 UI

내가 직면 한 문제는 텍스트를 입력하기 위해 텍스트 편집을 탭할 때입니다. 안드로이드 키보드가 내 편집 텍스트를 위로 움직이는 화면 하단에 표시되고 내 단추가 그 순간 편집 텍스트 위로 이동합니다. 키보드를 닫으면 모든 것이 정상입니다. 나는 이것이 왜 일어나고 있는지에 관해서는 단서가 없으며 편집 텍스트로 기본에 대해 알지 못합니다. 여기 내 XML 파일 ...

<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:paddingLeft="@dimen/activity_horizontal_margin" 
    android:paddingRight="@dimen/activity_horizontal_margin" 
    tools:context=".ResultViewActivity" 
    android:background="@drawable/background" > 

<Button 
    android:id="@+id/homeButton" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignParentRight="true" 
    android:layout_alignParentTop="true" 
    android:background="@drawable/homebtnselectr" /> 

<EditText 
    android:id="@+id/resultEditText" 
    android:layout_width="fill_parent" 
    android:layout_height="200dip" 
    android:layout_alignRight="@+id/homeButton" 
    android:layout_centerVertical="true" 
    android:background="@drawable/curve_corners" 
    android:ems="10" 
    android:gravity="top" 
    android:inputType="textMultiLine" 
    android:overScrollMode="always" 
    android:paddingBottom="6dp" 
    android:paddingLeft="12dp" 
    android:paddingRight="12dp" 
    android:paddingTop="6dp" 
    android:scrollbarStyle="insideInset" 
    android:scrollbars="vertical" 
    android:text="abcajfklafladfk" 
    /> 


    <LinearLayout 
     android:id="@+id/get_news_lin_layout" 
     android:layout_height="wrap_content" 
     android:layout_width="wrap_content" 
     android:orientation="vertical" 
     android:layout_alignLeft="@+id/resultEditText" 
     android:layout_alignParentBottom="true" 
    > 

    <Button 
     android:id="@+id/getNews" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:background="@drawable/getnews_btn_selectr" 
    /> 
    <TextView 
     android:id="@+id/get_news" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_gravity="center" 
     android:text="Get News" 
     android:textSize="20dp" 
     android:textStyle="bold" /> 

    </LinearLayout> 
</RelativeLayout> 
이다

this is normal activity without keyboard

this is same activity when tapped on edit text and keyboard appears

답변

2

이 줄을 추가보십시오 : 당신의 활동에 라인 아래에 넣어

android:windowSoftInputMode="adjustPan" 
+0

나는 확실히 그것을 시도 할 것이지만 그것이 실제로 무엇을 설명하면 큰 도움이 될 것입니다. –

+0

당신의 소프트 키보드가 액티비티에 나타날 때마다 ... layout은 결코 adjustPane에서 영향을 미치지 않습니다. –

1

매니페스트 파일에있는 LinearLayout

android:layout_below="@+id/resultEditText" 
+0

이 문제는 해결 될 것이지만 편집 텍스트 바로 아래에 내 버튼이 필요 없기 때문에 올바른 방법을 생각하지 않아도됩니다. –

0

버튼이 선형 레이아웃이지만 선형 레이아웃이 상대 레이아웃의 하위이기 때문에 이러한 현상이 발생한다고 생각합니다. edittext 이후의 상대 레이아웃 끝내기