一. 新建一个Activity 和 Layout 首先在layout文件夹中新建一个activity_main.xml,在新建工程的时候一般默认会新建此xml文件,修改其代码如下: activity_main.xml 代码 修改MainActivity.java文件代码如下:publi...
分类:
其他好文 时间:
2015-01-20 10:16:53
阅读次数:
415
一、第一种方法:
(1)Fragment的第一种使用方法是使用fragment加载单独的布局文件:(也就是xml的方式实现)
结构如下:
activity_main.xml主要是在一个线性布局中添加两个线性布局
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:t...
分类:
移动开发 时间:
2015-01-19 22:46:36
阅读次数:
173
//activity_main.xml<LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:contex..
分类:
移动开发 时间:
2015-01-14 18:17:07
阅读次数:
234
//activity_main.xml<LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:contex..
分类:
移动开发 时间:
2015-01-14 18:12:58
阅读次数:
242
//activity_main.xml<LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.vincentlin.checkbox.Main..
分类:
移动开发 时间:
2015-01-14 18:06:40
阅读次数:
183
Android MVC Demo范例参考,基本上很清晰和标准
MVC就是将V(View)和M(Model)通过C(Controller)分离开,降低耦合度。
这里给出一个自己写的Android MVC参考的规范:
项目结构:
布局XML(activity_main.xml):
<RelativeLayout xmlns:android="h...
分类:
移动开发 时间:
2015-01-14 11:05:23
阅读次数:
214
模拟扫描文件的效果,模拟雷达扫描。
思路:
1.使用旋转动画和渐变动画的结合。
2.使用线程和Handler进行消息的传递,刷新界面
不要在主线程上做耗时操作,不要在主线程上刷新界面。
activity_main.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
and...
分类:
其他好文 时间:
2015-01-12 13:07:57
阅读次数:
122
首先我们在activity_main.xml里面先定义一个Button空间123456789101112131415好,现在要我们来看点击事件的四种写法:1.最常见的一种写法——匿名的内部类做为事件监听器类package com.basillee.blogdemo;import android.os...
分类:
移动开发 时间:
2015-01-12 12:49:36
阅读次数:
154
publicclassMainActivityextendsActivity{
privateButtonbtn_click;
privateNotificationManagermanager;
@Override
protectedvoidonCreate(BundlesavedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
btn_click=(But..
分类:
其他好文 时间:
2015-01-07 11:14:32
阅读次数:
114
android提供了一个WebView控件,借助它我们就可以在自己的应用程序中嵌入一个浏览器,从而轻松的展示各种各样的网页。下面来学习下简单的用法。新建一个WebViewTest项目,然后修改activity_main.xml中的代码,如下所示:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"...
分类:
移动开发 时间:
2015-01-06 00:53:47
阅读次数:
284