当触摸Edittext字段时,永远不会打开键盘。我不知道这个问题的原因。但是,我不能在我的应用程序中写任何编辑文本字段。我的阶梯;
apply plugin: 'com.android.application'android {
compileSdkVersion 27
defaultConfig {
applicationId "dotdotdot"
minSdkVersion 22
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}}dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2',{
exclude group: 'com.android.support', module: 'support-annotations'
})implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:support-v4:27.1.0'
implementation 'com.android.support:design:27.1.0'
implementation 'com.android.support:palette-v7:27.1.0'
implementation 'com.android.support:cardview-v7:27.1.0'
implementation 'com.android.support:recyclerview-v7:27.1.0'
implementation 'com.android.support:support-vector-drawable:27.1.0'
implementation 'com.jakewharton:butterknife:8.5.1'
implementation 'com.github.filippudak.progresspieview:library:1.0.+'
implementation 'com.github.rahatarmanahmed:circularprogressview:2.5.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.google.code.gson:gson:2.8.0'
implementation 'com.roughike:bottom-bar:2.0.2'
implementation 'com.intuit.sdp:sdp-android:1.0.5'
implementation 'com.android.volley:volley:1.0.0'
implementation 'com.github.bumptech.glide:glide:4.6.1'
implementation 'com.github.bumptech.glide:glide:4.6.1'
implementation 'com.github.d-max:spots-dialog:0.7@aar'
implementation 'com.github.aakira:expandable-layout:1.4.2@aar'
implementation 'com.github.mirrajabi:search-dialog:1.1'
implementation 'com.roomorama:caldroid:3.0.1'
implementation 'net.igenius:customcheckbox:1.3'
implementation 'com.evrencoskun.library:tableview:0.8.6'
implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.10.0'
implementation 'com.github.piasy:GlideImageLoader:1.4.6'
implementation 'com.googlecode.json-simple:json-simple:1.1'
implementation 'org.sufficientlysecure:html-textview:3.5'
implementation 'com.github.irshulx:laser-native-editor:2.1.0'
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
implementation 'jp.wasabeef:glide-transformations:3.1.1'
implementation 'com.github.firdausmaulan:GlideSlider:1.1.0'
implementation 'com.google.code.gson:gson:2.8.0'
implementation 'com.afollestad.material-dialogs:commons:0.9.6.0'
implementation 'com.afollestad.material-dialogs:core:0.9.6.0'
implementation 'com.alespero:expandable-cardview:0.6'我的样本EditText区域:
<LinearLayout
android:layout_marginTop="5dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="30dp"
android:text="Notlar"
android:textStyle="bold" />
<EditText
android:id="@+id/notes"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/details_top_margin_large"
android:hint="No Data.."
android:textColor="@color/colorAccent"
android:textSize="14sp"
android:textStyle="bold" />
</LinearLayout>我有两个活动。LoginActivity和MainActivity.也有很多碎片。
编辑文本在LoginActivity (用户名和密码)中运行良好,但在MainActivity中没有任何编辑文本工作。
昨天我对SDK做了一个重大的更新。我不知道它是否与它有关,因为我没有对守则作太多修改。
我解决了问题。这花了一天时间。我不知道为什么,但我把这个项目移到了一个新的项目。编辑文本字段现在正在工作。
发布于 2018-08-27 19:34:32
你的EditText在我的手机上运行得很好,无论是虚拟的还是真实的。
然而,
如果没有安装所有SDK工具,则可能会导致此问题。请安装SDK工具部分中列出的所有内容。
希望能帮上忙。
发布于 2018-08-27 21:29:46
如果其他解决方案尚未工作,您可以尝试使EditText焦点可用:
android:focusable="true"
android:focusableInTouchMode="true"https://stackoverflow.com/questions/52045431
复制相似问题