当我尝试写入其属性时,Android Weight 未显示其属性。但是如果写就可以了。现在我想在写作时观看建议。我怎么解决这个问题?检查图像以获得更清晰的效果。
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/linearLayout2"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/textView2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:padding="10dp"
android:text="TextView"
android:textColor="#000"
android:textSize="30sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
[更新] 我还添加了我的 app/build.gradle 文件 我重新启动了我的 android 工作室,但我遇到了同样的问题。我创建了一个新项目,问题就在那里。
我的应用程序/build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.rocketechit.officemanagementapp"
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.0-beta01'
implementation 'androidx.constraintlayout:constraintlayout:1.1.2'
implementation 'androidx.legacy:legacy-support-v4:1.0.0-beta01'
implementation 'com.google.android.material:material:1.0.0-beta01'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0-alpha4'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'
//Butter knife
implementation 'com.jakewharton:butterknife:10.0.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.0.0'
//firebase
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.3'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
//picasso
implementation 'com.squareup.picasso:picasso:2.71828'
//circle image view
implementation 'de.hdodenhof:circleimageview:3.0.0'
//custom calender
implementation 'sun.bob:mcalendarview:1.0.0'
//scanner
implementation 'com.google.zxing:core:3.2.1'
implementation 'com.journeyapps:zxing-android-embedded:3.2.0@aar'
}
apply plugin: 'com.google.gms.google-services'
最佳答案
File -> Invalidate Caches / Restart... -> Select Invalidate and Restart
试试上面的代码,它会清除 android studio 中的所有缓存。希望它会起作用:)
编辑
从项目中删除.idea文件夹和所有.iml文件,然后重启Android Studio并重建gradle 将在这种情况下工作。不要忘记在删除后使缓存无效/重新启动
如果上述情况仍然不适合你那么你需要从android studio中删除系统文件
yourPathToDrive:/.AndroidStudio3.3/system
关于Android 小部件不显示它的属性我要写时的建议,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55040005/