" android:elevation ="不适用于带有编译API21的棒棒糖之前的设备 [英] "android:elevation=" doesn't work on devices pre-Lollipop with compile API21

查看:98
本文介绍了" android:elevation ="不适用于带有编译API21的棒棒糖之前的设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在应用程序中使用 android:levation = ,但是一旦运行,它就不会出现在装有android 4.1.2的设备中

I'm trying to use "android: elevation =" in my application but once I run it does not appear in the device with android 4.1.2

渐变

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"

    defaultConfig {
        applicationId "com.example.alvaro.proyectocaronte"
        minSdkVersion 14
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:21.0.3'
}

layout.xml

<RelativeLayout
                android:layout_width="1100dp"
                android:layout_height="fill_parent"
                android:background="@drawable/rounded_corner"
                android:layout_alignParentTop="true"
                android:layout_alignParentRight="true"
                android:layout_alignParentEnd="true"
                android:layout_marginRight="93dp"
                android:layout_marginEnd="93dp"
                android:elevation="3dp"/>

也许我没有为棒棒糖之前的设备正确编译棒棒糖,有什么建议吗?

maybe I'm not compiling correctly Lollipop for pre-lollipop devices, Any suggestions?

如果您需要查看代码的其他部分,我将编辑问题

If you need to see other parts of the code, I'll edit the question

谢谢

推荐答案

海拔高度要求设备运行棒棒糖。查看有关如何模拟海拔高度的答案 https://stackoverflow.com/a/26747592/680249

Elevation requires the device to run Lollipop. See this answer on how to simulate elevation https://stackoverflow.com/a/26747592/680249

这篇关于&quot; android:elevation =&quot;不适用于带有编译API21的棒棒糖之前的设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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