Attribute xx is only used in API level XX and higher (current min is xx) workaround

Source: Internet
Author: User

Error: Attribute "" is a used in API level and higher (current min is 10)

Problem Recurrence:


1. The problem encountered in the XML layout is due to the fact that the least compatible API is configured.

For example, configure in Androidmanifest:

<uses-sdk

Android:minsdkversion= "10"

Android:targetsdkversion= "/>"

2, compatible to API 10 is 2.3.3 system.

3. The Api21 attribute is used in the layout at this time:android:transitionname= "y"

< Relativelayout

android:id="@+id/titlelayout"

android:transitionname= "y"

android:layout_width= "Match_parent"

android:layout_height= "45DP"

Android:background= "@color/redcolor" >

4, you will be warned: Attribute "Transitionname" is only used at API level and higher (current min is

10)

5. The solution is to create a new values-xx based on the version of the attribute, according to the above example, we need to create a new values-v21 file

Create a new styles.xml in there.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/71/37/wKioL1XJY1zBYJCRAAKvpapa7Fc676.jpg "title=" 0cfb1f14-bbc7-4c4c-a971-e05a0a5a8a2e.png "alt=" Wkiol1xjy1zbyjcraakvpapa7fc676.jpg "/>

6. Introduce the style in the code

< Relativelayout

android:id="@+id/titlelayout"

style= "@style/transitionname"

android:layout_width="Match_parent"

android:layout_height="45DP"

android:background="@color/redcolor" >

Done, VALUES-V21 is a version of the resources


Attribute xx is only used in API level XX and higher (current min is xx) workaround

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.