Android Gradient on Lollipop not working. - API 21

后端 未结 5 1899
终归单人心
终归单人心 2020-12-09 20:16

When I try to use Gradient on Lollipop, it doesnt work. While it works on all previous versions.

Here is my example:



        
5条回答
  •  渐次进展
    2020-12-09 20:44

    int sdk = android.os.Build.VERSION.SDK_INT;
        if (sdk < Build.VERSION_CODES.LOLLIPOP) {
            //in your gradient use android:gradientRadius="500"
        } else {
          // in your gradient use android:gradientRadius="80%p" or 
          // android:gradientRadius="200dp"
    

    Try write two different xml files using different gradientRadius style

提交回复
热议问题