首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >@string/appbar_scrolling_view_ auto _auto未显示

@string/appbar_scrolling_view_ auto _auto未显示
EN

Stack Overflow用户
提问于 2020-10-07 07:48:12
回答 1查看 199关注 0票数 0

所以我在youtube上学习了这个教程,但是我被困在了11点08分,我不知道为什么我的@string/appbar_scrolling_view_behavior没有显示在我的activity.xml文件中。

顺便说一句,这是youtube的链接:

https://www.youtube.com/watch?v=Qxf8yQVkeik&list=PLFRUC61dWGGFqUezKOGzI4403pAjM-jCv&index=14

请不要反对我,如果你不喜欢我的问题,请给我关于这个问题和其他问题的建议,当我提出问题时,为了提高我的问题的技巧。

这是我的等级:

代码语言:javascript
运行
复制
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
    compileSdkVersion 30
    buildToolsVersion "30.0.2"

    defaultConfig {
        applicationId "com.example.simple_fragment_kotlin"
        minSdkVersion 16
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'androidx.core:core-ktx:1.3.1'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'




    // Android Support Library
    implementation 'com.google.android.material:material:1.0.0-alpha3'
}

这是我的android.xml文件:

代码语言:javascript
运行
复制
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayoutt 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"
    tools:context=".MainActivity">

    <com.google.android.material.appbar.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
        >
        <com.google.android.material.tabs.TabLayout
            android:id="@+id/tabs"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:tabTextColor="#000"
            app:tabSelectedTextColor="#fff"
            app:tabGravity="fill"
            app:tabMode="fixed"/>
    </com.google.android.material.appbar.AppBarLayout>

    <androidx.viewpager.widget.ViewPager
        android:layout_height="match_parent"
        android:layout_width="wrap_content"
        android:id="@+id/viewpager"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"
        />

</androidx.coordinatorlayout.widget.CoordinatorLayoutt>

我使用androidx api 30,用kotlin编程语言。

EN

回答 1

Stack Overflow用户

发布于 2020-10-07 08:38:27

在应用程序级梯度中添加下面的依赖项

代码语言:javascript
运行
复制
'com.google.android.material:material:1.3.0-alpha02'

我希望它能对你有用。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64239562

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档