小知识点收集

2016-09-07  本文已影响13人  贝贝ovo

1.android动画的ZAdjustment

2.本地图片 当做url mSimpleDraweeView.setImageURI("res:///" + R.mipmap.ic_launcher);

3.Android 换行符(\n) 在TextView中显示不正常的问题

1.如果直接在XML文件中写入"aaaaa\nbbbb"可以换行
2.如果在Java文件中用mTextView.setText("aaaaa\nbbbb")也可以换行
3.但在xml中引用string资源文件中的"aaaaa\nbbbb"不可以换行,还有连接中所说的 一个bean对象中的string字段,intent传递后,也不可换行

4.一个报错 android.content.res.Resources$NotFoundException: String resource ID #0x16

You are trying to set int value in tetview.setText() or Toast.makeText(), which it will take as string resource id.So try to give int value in like this.setText(""+intvalue)or Toast.makeText(context,""+intvalue,..)

5.ScrollView 的属性 android:fillViewport

Defines whether the scrollview should stretch its content to fill the viewport 定义滚动视图是否应该延伸它的内容来填充视口。

例如 一个scrollview 长宽match_parent ,包含一个TextView 长宽也为match_parent. 但结果显示的TextView高度还是wrap_content。给ScrollView加上属性android:fillViewport="true" 就出现想要的效果啦~。
6.ListView顶部默认有一个间距,向上滑动后,间距消失,clipToPadding=false配合paddingTop实现
android:clipToPadding意思是控件的绘制区域是否在padding里面。默认为true。如果你设置了此属性值为false,就能实现一个在布局上事半功陪的效果.

上一篇 下一篇

猜你喜欢

热点阅读