上一页 1 ··· 127 128 129 130 131 132 133 134 135 ··· 340 下一页
摘要: Android 获得view的宽和高 阅读全文
posted @ 2016-08-18 15:39 星辰之力 阅读(117) 评论(0) 推荐(0)
摘要: 我们平常可以直接在xml里设置margin,如: 但是有些情况下,需要在java代码里来写,可是View本身没有setMargin方法,怎么办呢? 通过查阅android api,我们发现android.view.ViewGroup.MarginLayoutParams有个方法setMargins( 阅读全文
posted @ 2016-08-17 16:53 星辰之力 阅读(1288) 评论(0) 推荐(0)
摘要: 工作上有业务需要判断textview是否换行,我的做法是判断textview要显示的字符串的宽度是否超过我设定的宽度,若超过则会执行换行。 项目中的其他地方也有这样的需求,故直接使用了那一块的代码。如下 这里是使用了TextPaint的measureText方法。 不过在项目实践上发现了这个方法存在 阅读全文
posted @ 2016-08-17 16:52 星辰之力 阅读(799) 评论(0) 推荐(0)
摘要: public static int px2sp(Context context, float pxValue) { final float fontScale = context.getResources().getDisplayMetrics().scaledDensity; return (int) (pxValue / fontScale + 0.5... 阅读全文
posted @ 2016-08-17 16:45 星辰之力 阅读(311) 评论(0) 推荐(0)
摘要: 界面适配的时候发现Paint.setTextSize与TextView.setTextSize传入的单位不一致。Paint.setTextSize传入的单位是px,TextView.setTextSize默认传入的单位是sp。 阅读全文
posted @ 2016-08-17 16:42 星辰之力 阅读(3372) 评论(0) 推荐(0)
摘要: import android.app.Activity; import android.graphics.*; import android.graphics.drawable.*; import android.os.Bundle; import android.widget.*; import android.widget.ImageView.ScaleType; public clas... 阅读全文
posted @ 2016-08-17 13:40 星辰之力 阅读(3241) 评论(0) 推荐(0)
摘要: Hadoop十篇文章 阅读全文
posted @ 2016-08-16 14:09 星辰之力 阅读(226) 评论(0) 推荐(0)
摘要: Android开发中高效的数据结构用SparseArray代替HashMap 阅读全文
posted @ 2016-08-16 10:33 星辰之力 阅读(204) 评论(0) 推荐(0)
摘要: 想达到此界面的风格 然后ViewPage里面第一个Fragment是一个瀑布流 这个瀑布流要有加载跟多 在ScrollView中,嵌套ViewPager,在ViewPager的每页使用Fragment并且Fragment中使用PullToRefreshListView,整体放在Fragment中ba 阅读全文
posted @ 2016-08-15 14:08 星辰之力 阅读(1833) 评论(1) 推荐(0)
摘要: The content of the adapter has changed but ListView did not receive a notification The content of the adapter has changed but ListView did not receive 阅读全文
posted @ 2016-08-15 10:23 星辰之力 阅读(188) 评论(0) 推荐(0)
上一页 1 ··· 127 128 129 130 131 132 133 134 135 ··· 340 下一页