国产成人精品久久免费动漫-国产成人精品天堂-国产成人精品区在线观看-国产成人精品日本-a级毛片无码免费真人-a级毛片毛片免费观看久潮喷

您的位置:首頁技術(shù)文章
文章詳情頁

android - layout_widthPercent加載dependencies后還是不能使用,是什么原因?

瀏覽:218日期:2024-08-24 08:41:06

問題描述

為什么添加依賴后,還是不能使用layout_widthPercent/layout_heightPercent?依賴:

dependencies { compile fileTree(dir: ’libs’, include: [’*.jar’]) androidTestCompile(’com.android.support.test.espresso:espresso-core:2.2.2’, {exclude group: ’com.android.support’, module: ’support-annotations’ }) compile ’com.android.support:percent:24.2.1’ compile ’com.android.support:appcompat-v7:24.2.1’ testCompile ’junit:junit:4.12’}

使用layout_widthPercent

<?xml version='1.0' encoding='utf-8'?><android.support.percent.PercentFrameLayout xmlns:android='http://schemas.android.com/apk/res/android' xmlns:app='http://schemas.android.com/apk/res-auto' android:layout_width='match_parent' android:layout_height='match_parent'> <Buttonandroid: android:text='Button1'android:layout_gravity='left|top'android:layout_widthPercent='50%'android:layout_heightPercent='50%'/></android.support.percent.PercentFrameLayout>

告警:

No resource identifier found for attribute ’layout_widthPercent’ in package ’android’

android - layout_widthPercent加載dependencies后還是不能使用,是什么原因?

問題解答

回答1:

謝邀. 沒有使用過 android.support.percent.PercentFrameLayout , 但是從 package 名字就大概知道它是support提供的, 非原生環(huán)境中所支持的Layout. 所以xml代碼應(yīng)該如下:

<?xml version='1.0' encoding='utf-8'?><android.support.percent.PercentFrameLayout xmlns:android='http://schemas.android.com/apk/res/android' xmlns:appCompat='http://schemas.android.com/apk/res-auto' android:layout_width='match_parent' android:layout_height='match_parent'> <Buttonandroid: android:text='Button1'android:layout_gravity='left|top'appCompat:layout_widthPercent='50%'appCompat:layout_heightPercent='50%'/></android.support.percent.PercentFrameLayout>

注意 appCompat 的定義和引用.最后說一點, 但凡在代碼里或者layout-xml能引用的Layout(or View), 都是可以正常使用的. 如果報錯, 那就是用法用錯了.

p.s. 如果答錯, 請直接踩這個回答吧(因為我沒具體使用過該P(yáng)ercentFrameLayout).

相關(guān)文章:
主站蜘蛛池模板: 午夜宅男在线永远免费观看网 | 欧美 亚洲 另类 自拍 在线 | 久久亚洲国产午夜精品理论片 | 女女同性一区二区三区四区 | 女人aaaaa片一级一毛片 | 自拍第一页| 成人国内精品久久久久影院 | 中文字幕一区二区小泽玛利亚 | 成人国产在线视频在线观看 | 国产成人精品日本亚洲专区6 | 成人午夜网| 成年女人毛片免费播放人 | 国产成人亚洲综合欧美一部 | 人人草97 | 99久久免费精品国产免费 | 一区自拍 | 女人张开双腿让男人桶爽免 | 亚洲欧美日韩中文字幕在线一 | 美女一级毛片视频 | 成人国产精品免费视频 | 欧洲一级鲁丝片免费 | 全国男人的天堂网站 | 综合91| 91久久精品| 一本色道久久88亚洲精品综合 | 国产精品久久久久久吹潮 | 韩国美女激情视频一区二区 | 日韩精品在线一区 | 亚洲一级免费视频 | 国产喷水女王在线播放 | 久久久久免费 | 精品韩国主播福利视频在线观看一 | 国内精品久久久久影院不卡 | 特级毛片aaa免费版 特级毛片a级毛免费播放 | 欧美亚洲国产精品久久 | 国产欧美亚洲精品 | 久草在线视频免费 | 日韩制服诱惑 | 久久国产毛片 | 最新亚洲情黄在线网站无广告 | 色丁香久久 |