LoginSignup
0
0

More than 5 years have passed since last update.

影と角丸とHardware accelerationの罠

Posted at

ICS以上端末サポートでの影(elevation)と角丸(ClipPath)を同時に使ったときにハマったので
ハードウェアアクセラレーション(HD)と影(elevation)と角丸(clippath)とAPI Levelの関係を備忘録がてら表にしておきます。

HDはAPI11以上はデフォルトON(*4)

   elevation(API21以上)   ClipPath 
HDオン 有効  API18以上(*4)
HDオフ 無効 有効

結果、自分はAPI21未満はelevationはあきらめて、API18未満はHDをオフ、API18以上はHDをオンでとりあえず対応しました

参考
*1)Elevation
https://developer.android.com/reference/android/view/View.html#setElevation(float)

*2)AndroidでViewを角丸にする
https://qiita.com/ushi3_jp/items/c568e7be76efafbe7de9

*3)Toolbarに影をつける方法まとめてみたhttps://qiita.com/tomoima525/items/d361d05adf6807e85ccd

*4)Hardware Acceleration
https://developer.android.com/guide/topics/graphics/hardware-accel.html
スクリーンショット 2018-01-31 2.52.32.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0