
android 小知识
wonderful_ha
这个作者很懒,什么都没留下…
展开
-
android中字体宽度获得
方法1: Rect bounds = new Rect(); mPaint.getTextBounds(mText,0,mText.length(),bounds); textWidth = bounds.width(); 方法2: textWidth = (int)mPaint.measureText(mText); grepcode原创 2012-06-20 21:01:49 · 1352 阅读 · 0 评论 -
Eclipse build Android时不生成apk问题解决方法
Eclisps有时build后不生成apk。没有对Eclise做过设置调整,android工程代码也是没有问题的。反正就是莫名奇妙的遇到两次,解决方法如下: 1、 设置:Preferences -> Android -> Build中有一项“Skip packaging and dexing until export or launch....”,去除勾选状态 2、 删除debug.key转载 2013-05-31 09:47:12 · 1149 阅读 · 0 评论 -
android sdk 下载注意点
1、 从网上下载 android_sdk_r17_windows.zip 2、解压后运行 sdk manager.exe 3、如发现无法 http://dl-ssl.google.com ,修改host 方法:74.125.237.1 dl-ssl.google.com 加入到host文件中 4、勾选相关sdk下载。原创 2013-05-30 19:23:01 · 1223 阅读 · 0 评论 -
android 项目R.java 文件不生成小总结
android项目 R.java资源文件不自动生成的原因有多种: 1. SDK有错误或找不到SDK 2. default.propites文件中定义的target=android-8与eclipse设置的不一致 3. 项目中有错误,xml文件错误,资源文件名不合法:有大写字符,数字开头,有空格等 其他 如AndroidManifest.xml里如果指定了 andro原创 2013-05-30 20:56:44 · 2536 阅读 · 0 评论 -
px 和dip 相互转化
import android.content.Context; public class DensityUtil { /** * 根据手机的分辨率从 dp 的单位 转成为 px(像素) */ public static int dip2px(Context context, float dpValue) {转载 2012-06-27 14:39:25 · 770 阅读 · 0 评论 -
ListView 动态删除添加Item方法
主要步骤: 1,删除或添加ListView对应的Adapter 的Data元素 2,调用adapter的 notifyDataSetChanged(),通知ListView进行重绘 如: private List> mPageInfoList; ………… mPageInfoList.remove(position); // 移除其中一个元素 Window原创 2012-06-26 21:19:34 · 1483 阅读 · 0 评论 -
Dialog背景透明无边框
@null true true false @color/transparent背景透明 @color/transparent false 在Dialog 构造函数中 public WindowListDialog(Context context, int theme) { s原创 2012-06-26 20:53:34 · 1339 阅读 · 0 评论 -
ListView 中含有Button ,让它Item能接收事件,并且button能够接收事件
在 每个Item中加入 android:descendantFocusability="blocksDescendants" 用来屏蔽focus 事件。使Item可以进行Foucs <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_wi原创 2012-06-26 21:23:25 · 678 阅读 · 0 评论 -
MeasureSpec 讲解
文章写太好了 http://www.cnblogs.com/slider/archive/2011/11/28/2266538.html转载 2012-06-21 14:10:15 · 589 阅读 · 0 评论 -
谷歌眼镜有哪些功能
从GPS导航、智能语言搜索、视频会议到Gmail电子邮件、日历、Googleplus和图片分享等,很多功能都被整合进谷歌眼镜的应用里。当你需要它们时,它们就开启;当你不需要时,它们就关闭。 下面是使用这些谷歌眼镜功能及谷歌眼镜的应用的一些指导: 谷歌眼镜功能一: 翻译搜索——你可以用谷歌眼镜去翻译一个短语,也可以翻译一个句子。或者去寻找一个高级方程式的解答,谷歌眼镜搜索功能都转载 2013-08-07 17:19:19 · 1800 阅读 · 0 评论