自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(19)
  • 收藏
  • 关注

转载 android:使用webview加载网页

android使用webview加载网页123456789101112131415161718192021222324252627282930

2015-10-08 13:25:43 631

转载 Android:布局实例之模仿微信Tab

微信Tab预览效果: 思路:1、用TabHost+RadioGroup搭建基本布局,以RadioGroup代替TabWidget2、设置按钮和文字的的样式和selector3、创建相应的Activity4、实现按钮和内容切换布局:xml version="1.0" encoding="utf-8"?>TabHost xm

2015-10-08 13:09:20 343

转载 Android:控件WebView显示网页

WebView可以使得网页轻松的内嵌到app里,还可以直接跟js相互调用。webview有两个方法:setWebChromeClient 和 setWebClientsetWebClient:主要处理解析,渲染网页等浏览器做的事情setWebChromeClient:辅助WebView处理Javascript的对话框,网站图标,网站title,加载进度等 WebVi

2015-10-08 13:08:36 183

转载 Android:简单的开场界面

接通过ImageView创建一个全屏的图片:xml version="1.0" encoding="utf-8"?>LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_

2015-10-08 13:07:01 728

转载 Android:自定义标题栏

现在很多的Android程序都在标题栏上都显示了一些按钮和标题,这里尝试做个实例在onCreate中添加://自定义标题requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);setContentView(R.layout.main);//设置标题为某个layoutgetWindow().setFeatureInt(Win

2015-10-07 22:54:03 244

转载 inflate方法与findViewById的区别

LayoutInflater作用是将layout的xml布局文件实例化为View类对象。对于一个没有被载入或者想要动态载入的界面,都需要使用LayoutInflater.inflate()来找 res/layout下的 xml 布局文件,并且实例化为View类对象;获取LayoutInflater的方法有如下三种:LayoutInflater inflater=(Lay

2015-10-07 22:49:46 278

转载 Android:使用ViewPager实现左右滑动切换图片(图上有点点)

在以下实例的基础上加上点点Android:使用ViewPager实现左右滑动切换图片 (简单版)效果预览:因为要把点点放图片上,所以修改布局为相对布局:xml version="1.0" encoding="utf-8"?>RelativeLayout xmlns:android="http://schemas.android.com/apk/res/

2015-10-07 22:47:09 533

转载 Android:再按一次退出程序

//两秒内按返回键两次退出程序 private long exitTime = 0; @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if(keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEven

2015-10-07 22:43:03 240

转载 Android系统自带样式(@android:style/)

在AndroidManifest.xml文件的activity中配置1、android:theme="@android:style/Theme"默认状态,即如果theme这里不填任何属性的时候,默认为Theme2、android:theme="@android:style/Theme.NoDisplay"任何都不显示。比较适用于只是运行了activity,但未显示任

2015-10-07 22:40:50 266

转载 Android:仿微信开场切换界面

这实例很多人仿做,好实例还是不容错过!最重要是素材容易拿~效果:默认3页面的切换,最后一个页面带按钮,点击进入另外一个页面 思路:1、准备5个布局页面,1个为主函数布局页面,3个为切换的页面(其一带按钮),1个为按钮点击进入的页面(这个需要Activity)。2、用适配器绑定相应的view,设置适配器3、制作点点,设置监听事件控制点点

2015-10-07 22:38:13 284

转载 Android:自定义适配器

无论是ArrayAdapter还是SimpleAdapter都继承了BaseAdapter,自定义适配器同样继承BaseAdapter实例:Gallery实现图片浏览器xml version="1.0" encoding="utf-8"?> Gallery xmlns:android="http://schemas.android.com/apk/res/android"

2015-10-07 22:35:26 259

转载 Android:改变Activity切换方式

overridePendingTransition(enterAnim, exitAnim);Intent intent =new Intent(this,item2.class);startActivity(intent);this.finish();overridePendingTransition(android.R.anim.slide_in_left,android.R.a

2015-10-07 22:34:05 221

转载 Android:布局实例之模仿京东登录界面

预览图及布局结构参考:布局: 1 xml version="1.0" encoding="utf-8"?> 2 RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 3 android:layout_width="match_parent" 4 a

2015-10-07 22:32:16 347

转载 Android:PopupWindow简单弹窗改进版

Android:PopupWindow简单弹窗继续上一节的内容,改进一下,目标是点击菜单后把菜单收缩回去并且切换内容,我使用的是PopupWindow+RadioGrouppublic class MainActivity extends TabActivity { private PopupWindow pop; private TabHost ta

2015-10-07 22:29:35 249

转载 Android:ViewPager制作幻灯片

布局:xml version="1.0" encoding="utf-8"?> RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="100d

2015-10-07 22:26:56 313

转载 Android:密码显示隐藏

效果:xml version="1.0" encoding="utf-8"?>LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_p

2015-10-07 22:24:11 319

转载 Android:储存方式之SharePreferences

使用SharedPreferences保存数据,其实质是采用了xml文件存放数据,存储位置:/data/data//shared_prefs 写入: public void writeData(View view){ //实例化SharedPreferences对象,参数1是存储文件的名称,参数2是文件的打开方式,当文件不存在时,直接创建,如果存在,

2015-10-07 22:17:43 196

转载 Android:利用SharedPreferences实现自动登录

Android:利用SharedPreferences实现自动登录主要代码:public class LoginActivity extends Activity { private EditText username; private EditText userpassword; private CheckBox remember;

2015-10-07 22:16:08 324

转载 Android:控件AutoCompleteTextView 客户端保存搜索历史自动提示

xml version="1.0" encoding="utf-8"?>LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" androi

2015-10-07 21:49:17 258

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除