gpt4 book ai didi

android - 操作栏支持 v7 android

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:30:00 26 4
gpt4 key购买 nike

IDE:Android Studio

  1. 创建新项目
  2. 将appcompat的.jar复制到/lib/
  3. 在项目设置中设置依赖
  4. 将编译“com.android.support:appcompat-v7:18.0.+”添加到build.gradle
  5. 添加如下代码:

    公共(public)类 MainActivity 扩展了 ActionBarActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    ActionBar actionBar = getSupportActionBar();
    actionBar.setTitle("hello");
    }

还有……什么都没有。获取下一个错误:

"Gradle: A problem occurred configuring project ':MyApplication'.
> Failed to notify project evaluation listener. > Could not resolve all dependencies for configuration ':MyApplication:_DebugCompile'.
> Could not find any version that matches com.android.support:appcompat-v7:18.0.+.
Required by:
MyApplicationProject:MyApplication:unspecified"

如何修复?我忘了做什么?

最佳答案

你需要安装支持库

3.Select the Android Support Library item.

Note: If you're developing with Android Studio, select and install theAndroid Support Repository item instead.http://developer.android.com/tools/support-library/setup.html

关于android - 操作栏支持 v7 android,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18761109/

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