AttributexxisonlyusedinAPIlevelxxandhigher(currentminis xx)的解決方法

錯(cuò)誤:Attribute "" is only used in API level 21 and higher (current min is   10)

創(chuàng)新互聯(lián)公司長(zhǎng)期為近千家客戶提供的網(wǎng)站建設(shè)服務(wù),團(tuán)隊(duì)從業(yè)經(jīng)驗(yàn)10年,關(guān)注不同地域、不同群體,并針對(duì)不同對(duì)象提供差異化的產(chǎn)品和服務(wù);打造開(kāi)放共贏平臺(tái),與合作伙伴共同營(yíng)造健康的互聯(lián)網(wǎng)生態(tài)環(huán)境。為鄞州企業(yè)提供專(zhuān)業(yè)的網(wǎng)站制作、網(wǎng)站建設(shè)鄞州網(wǎng)站改版等技術(shù)服務(wù)。擁有十年豐富建站經(jīng)驗(yàn)和眾多成功案例,為您定制開(kāi)發(fā)。

問(wèn)題重現(xiàn):

    

1、在xml布局中碰到這樣的問(wèn)題是由于  配置了最低兼容Api。

    例如在AndroidManifest中配置:

    <uses-sdk

        android:minSdkVersion="10"

        android:targetSdkVersion="21" />

2、兼容到Api 10 也就是2.3.3的系統(tǒng)。

3、此時(shí)在布局中使用了Api21的 屬性 :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、就會(huì)警告:Attribute "transitionName" is only used in API level 21 and higher (current min is 

 10)

5、解決方法如下根據(jù)屬性的版本新建一個(gè)values-xx,根據(jù)上述例子,我們需要新建一個(gè)values-v21的文件

在里面新建一個(gè)styles.xml

Attribute xx is only used in API level xx and higher (current min is   xx)的解決方法

6、在代碼中引入該style

    

<RelativeLayout

           android:id="@+id/titleLayout"

           

           android:layout_width="match_parent"

           android:layout_height="45dp"            

           android:background="@color/redColor">

大功告成,values-v21是對(duì)資源進(jìn)行版本適配

網(wǎng)站題目:AttributexxisonlyusedinAPIlevelxxandhigher(currentminis xx)的解決方法
本文路徑:http://bm7419.com/article48/pcgjep.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站設(shè)計(jì)Google、網(wǎng)站建設(shè)、、微信小程序、網(wǎng)站維護(hù)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

成都app開(kāi)發(fā)公司