如何使用材料的设计特点API低于月食21? [英] how to use material design features in api lower than 21 in eclipse?

查看:170
本文介绍了如何使用材料的设计特点API低于月食21?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有这方面的许多问题,但甚至没有一个帮助我。

所以,请告诉我如何能够在Eclipse材料的设计特点。

我还引进项目appcompat_v7库中,但它并没有创建名字values​​_v21这有助于在使用这些功能,我认为一个文件夹。

所以,请帮我在这

这是我的styles.xml文件

 < XML版本=1.0编码=UTF-8&GT?;
<资源>
    <样式名称=AppTheme父=@风格/ Theme.AppCompat.Light.DarkActionBar>
        <项目名称=机器人:actionBarStyle> @风格/ AppTheme_ActionBar< /项目>
        <项目名称=机器人:actionBarSize> @扪/ action_bar_height< /项目>
        <项目名称=机器人:windowContentOverlay> @可绘制/ actionbar_shadow< /项目>
        <项目名称=机器人:homeAsUpIndicator> @可绘制/ ic_ab_up_compat< /项目>
       <项目名称=机器人:actionBarTabTextStyle> @风格/ tabtextcolor< /项目>
        <项目名称=机器人:actionOverflowButtonStyle> @风格/ AppTheme_ActionBar_Overflow< /项目>
    < /风格>

    <样式名称=AppTheme_ActionBar父=机器人:Widget.Holo.ActionBar.Solid>
        <项目名称=机器人:背景> @色/ apptheme_primary< /项目>
         <项目名称=机器人:actionBarTabTextStyle> @风格/ tabtextcolor< /项目>
        <项目名称=机器人:图标> @可绘制/ actionbar_icon_placeholder_compat< /项目>
        <项目名称=机器人:titleTextStyle> @风格/ AppTheme_ActionBar_Title< /项目>
    < /风格>

    <样式名称=AppTheme_ActionBar_Title父=机器人:TextAppearance.Holo.Widget.ActionBar.Title>
        <项目名称=机器人:文字颜色> @android:彩色/白< /项目>
        <项目名称=机器人:TEXTSIZE> 20SP< /项目>
    < /风格>

    <样式名称=AppTheme_ActionBar_Overflow父=机器人:Widget.ActionButton.Overflow>
        <项目名称=机器人:SRC> @可绘制/ ic_ab_overflow_compat< /项目>

    < /风格>


    <样式名称=tabtextcolor父=@安卓风格/ Widget.Holo.Light.ActionBar.TabText>
    <项目名称=机器人:文字颜色> @android:彩色/白< /项目>
< /风格>
< /资源>
 

解决方案

有一些问题,你应该检查:

  • 导入Eclipse,Android的支持-V7-appcompat的最后一个版本 项目。你建议立即进行删除通过SDK管理器更新,并从导入项目 {your_path_to_android_sdk} /演员/安卓/支持/ V7 / appcompat

  • 该项目作为库依赖添加到您的项目

  • 在styles.xml使用Theme.AppCompat.Light或Theme.AppCompat:

    样式名称=AppTheme父=@风格/ Theme.AppCompat.Light

there are many questions regarding this but not even single helped me.

So please tell me how to enable material design features in eclipse.

i have also imported appcompat_v7 library in project but it does not create a folder with name values_v21 which helps in using those feature i think.

So please help me out in this

here is my styles.xml file

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="AppTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar">
        <item name="android:actionBarStyle">@style/AppTheme_ActionBar</item>
        <item name="android:actionBarSize">@dimen/action_bar_height</item>
        <item name="android:windowContentOverlay">@drawable/actionbar_shadow</item>
        <item name="android:homeAsUpIndicator">@drawable/ic_ab_up_compat</item>
       <item name="android:actionBarTabTextStyle">@style/tabtextcolor</item>
        <item name="android:actionOverflowButtonStyle">@style/AppTheme_ActionBar_Overflow</item>
    </style>

    <style name="AppTheme_ActionBar" parent="android:Widget.Holo.ActionBar.Solid">
        <item name="android:background">@color/apptheme_primary</item>
         <item name="android:actionBarTabTextStyle">@style/tabtextcolor</item>
        <item name="android:icon">@drawable/actionbar_icon_placeholder_compat</item>
        <item name="android:titleTextStyle">@style/AppTheme_ActionBar_Title</item>
    </style>

    <style name="AppTheme_ActionBar_Title" parent="android:TextAppearance.Holo.Widget.ActionBar.Title">
        <item name="android:textColor">@android:color/white</item>
        <item name="android:textSize">20sp</item>
    </style>

    <style name="AppTheme_ActionBar_Overflow" parent="android:Widget.ActionButton.Overflow">
        <item name="android:src">@drawable/ic_ab_overflow_compat</item>

    </style>


    <style name="tabtextcolor" parent="@android:style/Widget.Holo.Light.ActionBar.TabText">
    <item name="android:textColor">@android:color/white</item>
</style>
</resources>

解决方案

There are some points you should check:

  • Import into eclipse, last version of android-support-v7-appcompat project. You shoul update via SDK Manager, and import project from {your_path_to_android_sdk}/extras/android/support/v7/appcompat

  • Add this project as library dependency to your project

  • In styles.xml use Theme.AppCompat.Light or Theme.AppCompat:

    style name="AppTheme" parent="@style/Theme.AppCompat.Light"

这篇关于如何使用材料的设计特点API低于月食21?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆