2017-03-17 2 views
0

입력란을 편집 할 때 맨 위에있는 파란색 부분이 사라지는 이유는 무엇입니까? (이미지 포함)? 이 문제를 어떻게 해결할 수 있습니까?입력란에 타이핑 할 때 내 ActionBar가 사라지는 이유는 무엇입니까?

레이아웃은 그것을해야한다 같이 (이되어서는 안 됨) enter image description here 레이아웃을 입력 할 때 : enter image description here 레이아웃을 (이되어서는 안 됨) 내가 입력 한 후 : enter image description here

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: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="nl.bosschert.john.rebornsportschallengegui.MainActivity$PlaceholderFragment"> 

<TextView 
android:layout_width="match_parent" 
android:layout_height="wrap_content" 
android:layout_alignEnd="@+id/editTextRondes" 
android:layout_alignStart="@+id/editTextRondes" 
android:layout_alignTop="@+id/editTextRondes" 
android:layout_marginTop="-80dp" 
android:text="Hoeveel rondes heb je gemaakt?" 
android:textAlignment="center" 
android:textColor="@color/header" 
android:textSize="@dimen/header" 
android:textStyle="bold" /> 

<EditText 
    android:id="@+id/editTextRondes" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignParentTop="true" 
    android:layout_below="@id/editTextRondes" 
    android:layout_centerHorizontal="true" 
    android:layout_marginTop="200dp" 
    android:hint="Aantal rondes" 
    android:textColor="@color/header" 
    android:textColorHint="@color/colorRondesHint" /> 
</RelativeLayout> 
+0

UI가 너무 복잡하지 않으므로 서로의 관련성을 피하기 위해 선형 레이아웃을 사용해보십시오. –

답변

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="nl.bosschert.john.rebornsportschallengegui.MainActivity$PlaceholderFragment"> 

    <TextView 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_marginTop="200dp" 
     android:layout_centerHorizontal="true" 
     android:text="Hoeveel rondes heb je gemaakt?" 
     android:textAlignment="center" 
     android:textColor="@color/header" 
     android:textSize="@dimen/header" 
     android:textStyle="bold" /> 

    <EditText 
     android:id="@+id/editTextRondes" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_below="@id/editTextRondes" 
     android:layout_centerHorizontal="true"  
     android:hint="Aantal rondes" 
     android:textColor="@color/header" 
     android:textColorHint="@color/colorRondesHint" /> 

</RelativeLayout> 
1

너의 레이아웃은이 라인을 제외하고는 괜찮은 것 같다. 이것은 적절하지 않다. 아마도이 문제의 원인이 될 수있는 다른 코드가있다. 가 manifest.xml 수정 :

<activity 
     android:name=".xxxActivity" 
     android:windowSoftInputMode="adjustResize"/> 

또는 :

+0

그게 내 문제를 해결하지 못했지만 다가오는 많은 문제를 해결할 것이라고 생각합니다 :) – Johnnybossboy

0

이 시도 이 RelativeLayout의에 <ScrollView>를 추가합니다. kingfeng에서 제공

<ScrollView> 
    <RelativeLayout> 
    ... 
    </RelativeLayout> 
</ScrollView> 
+0

이것은 내 갤럭시 S7에서 작동했지만 내 갤럭시 S4 및 갤럭시 S5에서는 작동하지 않습니다 ... 내가 제안한 코드를 삭제하면 문제는 내 Galaxy S7에서만 발생하며 Galaxy S5 및 S4에서는 사라집니다. 어떻게 든 문제를 일으키는 것은 내 휴대폰이라고 생각합니다. 어쩌면 그것은 내가 안드로이드에서 선택할 수있는 내 사용자 지정 화면 크기 설정 (HD/FHD/WQHD)과 관련이 있습니다. 7) – Johnnybossboy

0

대답은하지만, 내 삼성 갤럭시 S7에 내 문제를 해결 내 삼성 갤럭시 S5와 삼성 갤럭시 S4에 문제를 만들었습니다. 내 갤럭시 S4 & 갤럭시 S5에 그러나, 내 갤럭시 S7에 AndroidManifest.xml을

이 한 일을 수정하지 ... 내가 코드 kingfeng 알 수 삭제하면 문제를 :

이 시도 내 갤럭시 S7에만 존재하며 내 갤럭시 S5와 S4에서는 사라집니다. 어떻게 든 문제를 일으키는 것은 내 휴대폰이라고 생각합니다. 아마 내가 선택할 수있는 내 사용자 지정 화면 크기 설정 (HD/FHD/WQHD)과 관련이 있습니다. 7)

어쨌든, 필자는 필요 없으므로 ActionBar를 삭제하기로 결정했습니다.

관련 문제