我试图使用此代码将EditText设置为不可编辑:
<EditText android:id="@+id/outputResult"
android:inputType="text"
android:editable="false"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/result" />
Run Code Online (Sandbox Code Playgroud)
我不得不添加这个不可编辑
android:focusable="false"
Run Code Online (Sandbox Code Playgroud)
难道我做错了什么?
非常感谢你
我正在开发一个角度应用程序。当我使用ng serve. 但是,当我运行时ng build --prod,它给出了以下错误。
ERROR in Illegal State: referring to a type without a variable {"filePath":"/Users/admin/Documents/projects/simply-science-web-ui/simply-science/node_modules/@angular/forms/forms.d.ts","name":"NgControlStatusGroup","members":[]}
Run Code Online (Sandbox Code Playgroud)
我不明白这是什么问题。请帮我解决这个问题。如果需要任何进一步的信息,请告诉我。
更新:
依赖:
"dependencies": {
"@angular/animations": "~8.1.2",
"@angular/common": "~8.1.2",
"@angular/compiler": "~8.1.2",
"@angular/core": "~8.1.2",
"@angular/forms": "~8.1.2",
"@angular/platform-browser": "~8.1.2",
"@angular/platform-browser-dynamic": "~8.1.2",
"@angular/router": "~8.1.2",
"rxjs": "~6.4.0",
"tslib": "^1.9.0",
"zone.js": "~0.9.1"
}
Run Code Online (Sandbox Code Playgroud)
其他:
Angular CLI: 8.1.3
Node: 10.16.0
OS: darwin x64
Angular: 8.1.3
Run Code Online (Sandbox Code Playgroud)
谢谢...
我刚开始在准备测试的 android(替换 Dagger 2)项目中使用 Koin lib。我在模块中的 android 应用上下文有问题:
val M = module {
val ctx = androidApplication() //here error
}
Run Code Online (Sandbox Code Playgroud)
Koin 在 App 类中启动:
import android.app.Application
import android.content.Context
import org.koin.android.ext.android.startKoin
class App : Application() {
override fun onCreate() {
super.onCreate()
startKoin(this, listOf(M))
}
}
Run Code Online (Sandbox Code Playgroud)
我得到日志:
D/App: onCreate()
I/KOIN: [context] create
E/KOIN: [ERROR] - Error while resolving instance for class 'android.app.Application' - error: org.koin.error.NoBeanDefFoundException: No compatible definition found for type 'Application'. Check your module definition
Run Code Online (Sandbox Code Playgroud)
并且应用程序崩溃。我是否错过了 Koin 配置中的某些内容?在目标项目中,我有几个深深依赖于应用程序上下文的模块。而且我不想使用对这个上下文的全局引用。