【问题标题】:Material design on tablets Pre-Lollipop平板电脑上的材料设计 Pre-Lollipop
【发布时间】:2014-12-28 18:03:15
【问题描述】:

我实际上使用的是 Android Studio 1.0.2。 我正在尝试在 4.1.2 Android 版本的平板电脑上实现 Material Design

我想这样做:

好的,我正在阅读下一个博客:

问题:

我在 values/themes.xml 上有下一个代码:

<style name="Theme.MyTheme" parent="Theme.AppCompat.Light">
    <!-- Here we setting appcompat’s actionBarStyle -->
    <item name="actionBarStyle">@style/MyActionBarStyle</item>

    <!-- ...and here we setting appcompat’s color theming attrs -->
    <item name="colorPrimary">@color/my_awesome_red</item>
    <item name="colorPrimaryDark">@color/my_awesome_darker_red</item>

    <!-- The rest of your attributes -->
</style>

它会报告这样的错误:

(第一个问题)问题是什么?

(第二个问题) 如何在棒棒糖之前的平板电脑上实现 Material Design?我怎样才能做类似的设计? (第一个蓝色工具栏和另一个工具栏的内部内容)

真的,在问之前我已经试过了……

谢谢

【问题讨论】:

  • 我认为“Android 5.0”是指“材料设计”。 Android 5.0 Lollipop,所以谈论在没有 Lollipop 的情况下实现 Android 5.0 是不合理的。
  • 你是对的,已编辑
  • 到处都不需要“(Android 5.0)”。您只是在尝试实现 Material Design 的外观和感觉,对吧?如果是这样,这就是你需要说的。
  • 对,这是我第一次接触材料设计...

标签: android android-studio tablet android-5.0-lollipop


【解决方案1】:

第一个问题:您的themes.xml 文件似乎没有正确写入。您的顶级元素应该是&lt;resources&gt;。试试吧……

<resources>
    <style name="Theme.MyTheme" parent="Theme.AppCompat.Light">
        <!-- Here we setting appcompat’s actionBarStyle -->
        <item name="actionBarStyle">@style/MyActionBarStyle</item>

        <!-- ...and here we setting appcompat’s color theming attrs -->
        <item name="colorPrimary">@color/my_awesome_red</item>
        <item name="colorPrimaryDark">@color/my_awesome_darker_red</item>

        <!-- The rest of your attributes -->
    </style>
</resources>

第二个问题:您可能需要提供一些代码来显示您到目前为止所做的事情,这样就不需要有人为您编写整个事情了。

【讨论】:

  • 谢谢,效果很好。好的,我会为我的布局和课程添加代码
猜你喜欢
  • 2016-01-17
  • 1970-01-01
  • 2015-01-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-06-13
  • 1970-01-01
  • 2014-06-18
相关资源
最近更新 更多