Ich habe Probleme mit dem Verhalten eines EditText. Hier ist die Sache:Seltsames Verhalten in EditText
Wenn ich auf den EditText klicke, erscheint das SoftKeyboard und ich kann immer noch den EditText sehen (damit ich sehen kann, was ich schreibe). Aber wenn ich zuerst auf einen Button klicke oder wenn ich das SoftKeyboard verberge und erneut in den EditText klicke, erscheint das SoftKeyboard, aber der EditText befindet sich unter dem SoftKeyboard.
Ich habe mehrere Dinge ausprobiert. Meine App ist fullscreen, aber ich kann nicht finden, wo ich es gesetzt, weil ich nicht ein eigenes Thema und in meiner Tätigkeit mit mir dies nur haben:
<activity
android:name=".Textinput"
android:label="@string/title_activity_textinput"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="adjustResize|stateHidden"/>
Die .xml der Aktivität:
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="com.jesusortega.esloganquizz.Textinput"
tools:showIn="@layout/activity_textinput"
android:background="#171c22"
android:gravity="center_vertical"
android:orientation="vertical"
>
<ImageView
android:id="@+id/image"
android:layout_width="220dp"
android:layout_height="220dp"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="@dimen/activity_vertical_margin"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:layout_marginTop="@dimen/activity_vertical_margin"/>
<TextView
android:id="@+id/textview1"
android:layout_width="340dp"
android:layout_height="wrap_content"
android:background="@drawable/shadowbuttonblue"
android:textAllCaps="false"
android:textColor="#ffffff"
android:textSize="18sp"
android:gravity="left|center_vertical"
android:layout_gravity="end"
android:paddingEnd="50dp"
android:paddingRight="50dp"
android:paddingLeft="20dp"
android:paddingStart="20dp"
android:paddingBottom="10dp"
android:paddingTop="10dp"
android:layout_marginBottom="8dp"
android:layout_marginRight="-30dp"
/>
<Button
android:id="@+id/button1"
android:layout_width="340dp"
android:layout_height="40dp"
android:background="@drawable/shadowbuttongreen"
android:text="@string/string13"
android:textAllCaps="false"
android:textColor="#ffffff"
android:textSize="18sp"
android:gravity="right|center_vertical"
android:layout_gravity="left"
android:paddingEnd="20dp"
android:paddingRight="20dp"
android:paddingBottom="10dp"
android:paddingTop="10dp"
android:paddingLeft="50dp"
android:layout_marginBottom="8dp"
android:layout_marginLeft="-30dp"
android:onClick="function1"
/>
<Button
android:id="@+id/button2"
android:layout_width="340dp"
android:layout_height="40dp"
android:background="@drawable/shadowbuttonyellow"
android:text="@string/string14"
android:textAllCaps="false"
android:textColor="#ffffff"
android:textSize="18sp"
android:gravity="left|center_vertical"
android:layout_gravity="end"
android:paddingLeft="20dp"
android:paddingBottom="10dp"
android:paddingTop="10dp"
android:layout_marginBottom="8dp"
android:layout_marginRight="-30dp"
android:onClick="function1"
/>
<EditText
android:id="@+id/editText1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/string15"
android:textColorHint="#ffffff"
android:padding="10dp"
android:layout_marginRight="10dp"
android:layout_marginLeft="10dp"
android:layout_marginBottom="8dp"
android:background="@drawable/introducirtexto"
android:gravity="center_horizontal"
android:layout_gravity="center_horizontal"
android:textSize="18sp"
android:textColor="#ffffff"
android:textCursorDrawable="@null"
android:imeOptions="actionGo"
android:singleLine="true"/>
<Button
android:id="@+id/button3"
android:layout_width="340dp"
android:layout_height="40dp"
android:background="@drawable/shadowbuttonred"
android:text="@string/string16"
android:textAllCaps="false"
android:textColor="#ffffff"
android:textSize="18sp"
android:gravity="right|center_vertical"
android:layout_gravity="left"
android:paddingEnd="20dp"
android:paddingRight="20dp"
android:paddingBottom="10dp"
android:paddingTop="10dp"
android:layout_marginLeft="-30dp"
android:onClick="check"
/>
</LinearLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top|right"
android:layout_margin="10dp">
<Button
android:id="@+id/esquina"
android:layout_width="70dp"
android:layout_height="40dp"
android:drawableLeft="@drawable/small_coin"
android:background="@drawable/shadowbuttonblue"
android:padding="5dp"
android:textAllCaps="false"
android:textColor="#ffffff"
android:textSize="22sp"
android:onClick="coins"/>
</RelativeLayout>
ich weiß, dass der adjustResize nicht in vollem Umfang nutzen funktioniert, aber das ist nicht wichtig für mich, ich will nur die EditText jedes Mal, wenn ich in ihnen klicken, um zu sehen.
Danke.
Edit: Das ist mein gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.untoj.app"
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
}
Bitte sagen Sie mir, welche Version von Android-Bibliotheken haben Sie in Ihrem gradle –
Ich habe die Größe der Frage hinzugefügt – ridgeback