Android Hello, Gallery tutorial — “R.styleable cannot be resolved”

前端 未结 7 1860
一整个雨季
一整个雨季 2020-11-27 13:23

When working on the Hello, Gallery tutorial/sample app, after following the instructions on the site, Eclipse reported that R.styleable cannot be resolved.

What is t

相关标签:
7条回答
  • 2020-11-27 14:26

    styleable is not supported http://developer.android.com/sdk/RELEASENOTES.html

    The android.R.styleable class and its fields were removed from the public API, to better ensure forward-compatibility for applications. The constants declared in android.R.styleable were platform-specific and subject to arbitrary change across versions, so were not suitable for use by applications. You can still access the platform's styleable attributes from your resources or code. To do so, declare a custom resource element using a <declare-styleable> in your project's res/values/R.attrs file, then declare the attribute inside. For examples, see <sdk>/samples/ApiDemos/res/values/attrs.xml. For more information about custom resources, see Custom Layout Resources. Note that the android.R.styleable documentation is still provided in the SDK, but only as a reference of the platform's styleable attributes for the various elements.

    0 讨论(0)
提交回复
热议问题