[持续更新]Android小问题记录

文章若有价值,欢迎转载,转载请写明出处http://www.cnblogs.com/rossoneri/p/4040314.html

此文随时更新,旨在记录平时遇到的不值得单独写博客记录的细节问题。

 

1.xml中layout_gravity,gravity的区别。

 layout_gravity表示控件自身位置,gravity表示子组件的位置。

 

2.加imageView后提示Warning:Missing content Description attribute on image

Resolved this warning by setting attribute android:contentDescription for my ImageView

android:contentDescription="@string/desc"

Android Lint support in ADT 16 throws this warning to ensure that image widgets provide a contentDescription.

This defines text that briefly describes content of the view. This property is used primarily for accessibility. Since some views do not have textual representation this attribute can be used for providing such.

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.

http://stackoverflow.com/questions/8500544/android-lint-contentdescription-warning

 

3.eclipse编译时长时间refreshing external folders导致等待时间过长

选择project->properties
选择Java build path->libraries->android.jar->source attachment,remove掉Source attachment中的路径

 

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。