gpt4 book ai didi

android - 未找到附加的属性 fab

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:12:20 25 4
gpt4 key购买 nike

当我使用 Material 组件时无法运行项目。

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'android.arch.lifecycle:extensions:1.1.1'

implementation 'com.facebook.fresco:fresco:1.11.0'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.+'
implementation 'com.fxn769:pix:1.2.5'




implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-v4:28.0.0'

}

错误日志:

Android resource linking failed Output: D:\Android Projects\Ghar3\app\src\main\res\layout\main_layout.xml:23: error: attribute fabAttached (aka com.recreation.ghar:fabAttached) not found. error: failed linking file resources.

Command: C:\Users\Abdul Qadir.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\93d85fd8448aa5b91b30eb47e2faac6a\aapt2-3.2.1-4818971-windows\aapt2.exe link -I\ D:\sdk\Android\sdk\platforms\android-28\android.jar\ --manifest\ D:\Android Projects\Ghar3\app\build\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\ -o\ D:\Android Projects\Ghar3\app\build\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\ -R\ @D:\Android Projects\Ghar3\app\build\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\ --auto-add-overlay\ --java\ D:\Android Projects\Ghar3\app\build\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\ --custom-package\ com.recreation.ghar\ -0\ apk\ --output-text-symbols\ D:\Android Projects\Ghar3\app\build\intermediates\symbols\debug\R.txt\ --no-version-vectors Daemon: AAPT2 aapt2-3.2.1-4818971-windows Daemon #0

最佳答案

看起来这个属性在androidx中已经被移除了。要附加操作栏,只需将属性 app:layout_anchor 添加到您的 fab。

<com.google.android.material.floatingactionbutton.FloatingActionButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
app:fabSize="normal"
android:src="@drawable/ic_add_white_24dp"
app:layout_anchor="@id/bottom_app_bar"/>

关于android - 未找到附加的属性 fab,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52923933/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com