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的推送等等逻杖。