Android L - android.graphics.outline

你说的曾经没有我的故事 提交于 2019-12-11 03:28:24

问题


According to the android developer page for the developer preview of L, it's possible to use the Outline class & define outlines for view's to display the shadows in the correct way. (http://developer.android.com/preview/material/views-shadows.html#shadows)

In my case, the "L"-sdk I use, didn't found it. Therefore I couldn't import and use the class.

According to the test project, stored in sdk/samples/android-L/ui/views/Elevation/ElevationDrag this class should be stored in "android.graphics.outline", but even in this project it can't be located correctly.

Is this feature not implemented in the developer preview yet or did I missed something?


回答1:


Finally got it.

It's a bug in android studio. I just added manually the import to my activity:

import android.graphics.Outline

It will be shown as error, but it can compile & run. I hope they will fix this soon.

EDIT: I created an issue here: https://code.google.com/p/android/issues/detail?id=72788&q=android%20studio%20android%20l&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars

It looks like, they're working on it.




回答2:


The same problem than you but your answer it didn't work for me, I am trying to import

import android.graphics.outline;

And de output is:

Error:(7, 24) error: cannot find symbol class outline

The build.gradleseems to be well configurated with the compileSdkVersion 'android-L' sentence

** Fixed

the right import is: import android.graphics.Outline;



来源:https://stackoverflow.com/questions/24476179/android-l-android-graphics-outline

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!