3.1
ButtonButton这控件不用多说,就是一个按钮,主要是点击后进行相应事件的响应。给组件添加ID属性:定义格式为
android:id="@+id/name",这里的name是自定义的,不是索引变量。“@+”表示新声明,"@"表示引用,例如:"@+id/tv"
表示新声明一个id,是id...
分类:
移动开发 时间:
2014-05-20 00:43:56
阅读次数:
426
在实际编程时,要使Log4j真正在系统中运行事先还要对配置文件进行定义。定义步骤就是对Logger、Appender及Layout的分别使用。Log4j支持两种配置文件格式,一种是XML格式的文件,一种是java
properties(key=value)【Java特性文件(键=值)】。(这里只说明...
分类:
其他好文 时间:
2014-05-18 19:28:57
阅读次数:
367
public class MainActivity extends Activity {
private ImageView operImage;
private PointF point = new PointF();//记录手指的位置
private PointF midPoint = new PointF();//记录手指间的中点的位置
private Matrix matrix...
分类:
移动开发 时间:
2014-05-18 18:44:57
阅读次数:
363
不难看出,在RelativeLayout被add/attach到父View之前mLayoutParams成员为空,调用measure方法将导致上图标注处代码抛出空指针异常。
解决方案有两种
a) 在measure之前显式设置LayoutParams(代表着对父View的Layout请求,必须是父View的内部LayoutParams类型)
b) 自动设置LayoutParams的inflate方式...
分类:
编程语言 时间:
2014-05-18 18:26:17
阅读次数:
576
public class MainActivity extends Activity {
private ImageView iv;
float startX = 0;
float startY = 0;
//获得一个可以被bitmap
Bitmap bitmap = Bitmap.createBitmap(400, 400,Bitmap.Config.ARGB_8888);
//创...
分类:
移动开发 时间:
2014-05-18 15:54:33
阅读次数:
318
MainActivity如下:
package cc.cn;
import java.util.HashMap;
import org.json.JSONObject;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import com.android.volley....
分类:
移动开发 时间:
2014-05-18 15:18:31
阅读次数:
297
打蛇要打七寸,做事情要做要害,看东西要看本质。LinearLayout的本质,也就是他的最上层的类,其实是View类...
分类:
其他好文 时间:
2014-05-18 04:53:14
阅读次数:
222
MainActivity如下:
package cc.y;
import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.os.Bundle;
import and...
分类:
移动开发 时间:
2014-05-18 03:54:44
阅读次数:
365
*本文翻译自Yari Dareglia的[LEARN TO LOVE AUTO
LAYOUT][1]文章*[1]: http://www.thinkandbuild.it/learn-to-love-auto-layout/ "Think
& Build"先生们,女士们,让我们以正确的心态...
分类:
移动开发 时间:
2014-05-18 01:20:58
阅读次数:
519
public class MainActivity extends Activity {
TextView text1, text2; Button button; Thread th; @Override protected void
onCreate(B...
分类:
编程语言 时间:
2014-05-17 21:30:11
阅读次数:
351