“android:elevation=” doesn't work on devices pre-Lollipop with compile API21

后端 未结 4 477
后悔当初
后悔当初 2020-12-14 14:34

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

gradle

4条回答
  •  独厮守ぢ
    2020-12-14 15:20

    UPDATED ::

    1. Best Practice to do that is

      
          
      
      

      and add library for cardview

      dependencies {
         ...
         compile 'com.android.support:cardview-v7:21.0.+'
       }
      
    2. On Pre-Lollipop you can use this drawable

      android:background="@android:drawable/dialog_holo_light_frame"

      it will give you the look of elevation

    3. you can create your own like this

      
      
      
      
      
          
          
      
      
      
      
      
          
          
      
      
      
      

    reference

提交回复
热议问题