安卓 warning(二)

ImageView的contentDescription

Missing contentDescription attribute on image less... (Ctrl+F1)
Non-textual widgets like ImageViews and ImageButtons should use the contentDescription attribute to specify a textual description of the widget such that screen readers and other accessibility tools can adequately describe the user interface. Note that elements in application screens that are purely decorative and do not provide any content or enable a user action should not have accessibility content descriptions. In this case, just suppress the lint warning with a tools:ignore="ContentDescription" attribute. Note that for text fields, you should not set both the hint and the contentDescription attributes since the hint will never be shown. Just set the hint. See http://developer.android.com/guide/topics/ui/accessibility/checklist.html#special-cases.

大概可以從中讀出warning的意思

  • 對(duì)于那些具有功能性的圖片贤牛,對(duì)于有些盲人或者色弱等人,安卓中的輔助功能碎紊,talkback會(huì)借助contentDescription的內(nèi)容對(duì)該人群進(jìn)行幫助
  • 對(duì)于那些春裝飾性的圖片呀打,只需要使用tools:ignore="ContentDescription" 或者將description設(shè)置為@null

marginLeft

Redundant attribute layout_marginLeft; already defining layout_marginStart with targetSdkVersion 27 less... (Ctrl+F1)
Using Gravity#LEFT and Gravity#RIGHT can lead to problems when a layout is rendered in locales where text flows from right to left. Use Gravity#START and Gravity#END instead. Similarly, in XML gravity and layout_gravity attributes, use start rather than left. For XML attributes such as paddingLeft and layout_marginLeft, use paddingStart and layout_marginStart. NOTE: If your minSdkVersion is less than 17, you should add both the older left/right attributes as well as the new start/right attributes. On older platforms, where RTL is not supported and the start/right attributes are unknown and therefore ignored, you need the older left/right attributes. There is a separate lint check which catches that type of error. (Note: For Gravity#LEFT and Gravity#START, you can use these constants even when targeting older platforms, because the start bitmask is a superset of the left bitmask. Therefore, you can use gravity="start" rather than gravity="left|start".)

大致意思為left已經(jīng)再api27中被start取代

原因

有些字的習(xí)慣是從右邊開始寫起的,這個(gè)時(shí)候marginleft就會(huì)失去預(yù)期的效果翔试,而start則自動(dòng)進(jìn)行相應(yīng)的判斷并進(jìn)行鏡像切換

Application下的allowbackup屬性

Warning:On SDK version 23 and up, your app data will be automatically backed up and restored on app install. Consider adding the attribute android:fullBackupContent to specify an @xml resource which configures which files to backup. More info: https://developer.android.com/training/backup/autosyncapi.html

意思為應(yīng)用程序數(shù)據(jù)將在應(yīng)用程序安裝上自動(dòng)進(jìn)行備份和恢復(fù)

消除

在application下

android:fullBackupContent="@xml/backup_descriptor">
并自動(dòng)在xml包下創(chuàng)建backup_descriptor.xml
在這個(gè)xml文件中,可以定義需要備份(include)和不需要備份(exclude)的相關(guān)數(shù)據(jù),并指定數(shù)據(jù)保存方式

AndroidManifast警告App is not indexable by Google Search

Warning: App is not indexable by Google Search; consider adding at least one Activity with an ACTION-VIEW intent filter. See issue explanation for more details.

官方文檔

To enable Google to crawl your app content and allow users to enter your app from search results, you must add intent filters for the relevant activities in your app manifest. These intent filters allow deep linking to the content in any of your activities. For example, the user might click on a deep link to view a page within a shopping app that describes a product offering that the user is searching for.

Deeplink有什么用

舉例來(lái)說(shuō)瓣距,當(dāng)用戶在其他應(yīng)用或網(wǎng)頁(yè)中點(diǎn)擊了廣告時(shí),使用了Deeplink的商家APP代咸,可以直接跳轉(zhuǎn)到相應(yīng)商品的界面蹈丸;而沒有使用Deeplink的APP,就只能跳轉(zhuǎn)到首頁(yè)呐芥。包括新聞APP的推送等等逻杖。

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個(gè)濱河市思瘟,隨后出現(xiàn)的幾起案子荸百,更是在濱河造成了極大的恐慌,老刑警劉巖滨攻,帶你破解...
    沈念sama閱讀 222,681評(píng)論 6 517
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件够话,死亡現(xiàn)場(chǎng)離奇詭異,居然都是意外死亡光绕,警方通過(guò)查閱死者的電腦和手機(jī)女嘲,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 95,205評(píng)論 3 399
  • 文/潘曉璐 我一進(jìn)店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái)诞帐,“玉大人欣尼,你說(shuō)我怎么就攤上這事【鞍#” “怎么了媒至?”我有些...
    開封第一講書人閱讀 169,421評(píng)論 0 362
  • 文/不壞的土叔 我叫張陵,是天一觀的道長(zhǎng)谷徙。 經(jīng)常有香客問(wèn)我拒啰,道長(zhǎng),這世上最難降的妖魔是什么完慧? 我笑而不...
    開封第一講書人閱讀 60,114評(píng)論 1 300
  • 正文 為了忘掉前任谋旦,我火速辦了婚禮,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘册着。我一直安慰自己拴孤,他們只是感情好,可當(dāng)我...
    茶點(diǎn)故事閱讀 69,116評(píng)論 6 398
  • 文/花漫 我一把揭開白布甲捏。 她就那樣靜靜地躺著演熟,像睡著了一般。 火紅的嫁衣襯著肌膚如雪司顿。 梳的紋絲不亂的頭發(fā)上芒粹,一...
    開封第一講書人閱讀 52,713評(píng)論 1 312
  • 那天,我揣著相機(jī)與錄音大溜,去河邊找鬼化漆。 笑死,一個(gè)胖子當(dāng)著我的面吹牛钦奋,可吹牛的內(nèi)容都是我干的座云。 我是一名探鬼主播,決...
    沈念sama閱讀 41,170評(píng)論 3 422
  • 文/蒼蘭香墨 我猛地睜開眼付材,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼朦拖!你這毒婦竟也來(lái)了?” 一聲冷哼從身側(cè)響起伞租,我...
    開封第一講書人閱讀 40,116評(píng)論 0 277
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤贞谓,失蹤者是張志新(化名)和其女友劉穎,沒想到半個(gè)月后葵诈,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體裸弦,經(jīng)...
    沈念sama閱讀 46,651評(píng)論 1 320
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 38,714評(píng)論 3 342
  • 正文 我和宋清朗相戀三年作喘,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了理疙。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點(diǎn)故事閱讀 40,865評(píng)論 1 353
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡泞坦,死狀恐怖窖贤,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情贰锁,我是刑警寧澤赃梧,帶...
    沈念sama閱讀 36,527評(píng)論 5 351
  • 正文 年R本政府宣布,位于F島的核電站豌熄,受9級(jí)特大地震影響授嘀,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜锣险,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 42,211評(píng)論 3 336
  • 文/蒙蒙 一蹄皱、第九天 我趴在偏房一處隱蔽的房頂上張望览闰。 院中可真熱鬧,春花似錦巷折、人聲如沸压鉴。這莊子的主人今日做“春日...
    開封第一講書人閱讀 32,699評(píng)論 0 25
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)油吭。三九已至,卻和暖如春逊拍,著一層夾襖步出監(jiān)牢的瞬間上鞠,已是汗流浹背际邻。 一陣腳步聲響...
    開封第一講書人閱讀 33,814評(píng)論 1 274
  • 我被黑心中介騙來(lái)泰國(guó)打工芯丧, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留,地道東北人世曾。 一個(gè)月前我還...
    沈念sama閱讀 49,299評(píng)論 3 379
  • 正文 我出身青樓缨恒,卻偏偏與公主長(zhǎng)得像,于是被迫代替她去往敵國(guó)和親轮听。 傳聞我的和親對(duì)象是個(gè)殘疾皇子骗露,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 45,870評(píng)論 2 361

推薦閱讀更多精彩內(nèi)容