当前位置:  编程技术>移动开发
本页文章导读:
    ▪ubuntu12.10 装配jdk1.6        ubuntu12.10 安装jdk1.6 sudo gedit /etc/apt/sources.list打开源列表,在最后一行添加deb http://us.archive.ubuntu.com/ubuntu/ hardy multiverse。保存退出。2、sudo apt-get update3、sudo apt-get install sun-java6-jdk ......
    ▪ REActivityViewController 施用 备忘        REActivityViewController 使用 备忘 REActivityViewControllerOut of the box activities include:FacebookTwitterVKontakteTumblr (using XAuth)MessageMailOpen in SafariSave to PocketSend to InstapaperSave to ReadabilitySave to DiigoSave to KipptSave.........
    ▪ 怎么使用 Adapter       如何使用 Adapter Adapter 是listView和数据源之间的中间人   最简单的方法, 最慢最不实用: public View getView(int pos, View convertView, ViewGroup parent) { View item = mInflater.inflate(R.layout.list_item, null); ((TextView.........

[1]ubuntu12.10 装配jdk1.6
    来源: 互联网  发布时间: 2014-02-18
ubuntu12.10 安装jdk1.6

sudo gedit /etc/apt/sources.list
打开源列表,在最后一行添加
deb http://us.archive.ubuntu.com/ubuntu/ hardy multiverse。保存退出。

2、sudo apt-get update

3、sudo apt-get install sun-java6-jdk

    
[2] REActivityViewController 施用 备忘
    来源: 互联网  发布时间: 2014-02-18
REActivityViewController 使用 备忘
REActivityViewController

Out of the box activities include:

Facebook
Twitter
VKontakte
Tumblr (using XAuth)
Message
Mail
Open in Safari
Save to Pocket
Send to Instapaper
Save to Readability
Save to Diigo
Save to Kippt
Save to Album
Open in Maps
Print
Copy
All activites are compatible with iOS 5.0.

Requirements
Xcode 4.5 or higher
Apple LLVM compiler
iOS 5.0 or higher
ARC

Demo
First, you need to install dependencies using CocoaPods package manager in the demo project:

$ pod install


After that, build and run the REActivityViewControllerExample project in Xcode to see REActivityViewController in action.

If you don't have CocoaPods installed, check section "Installation" below.

Installation
The recommended approach for installating REActivityViewController is via the CocoaPods package manager, as it provides flexible dependency management and dead simple installation.

Install CocoaPods if not already available:

$ [sudo] gem install cocoapods
$ pod setup


Edit your Podfile and add REActivityViewController:
$ edit Podfile
platform :ios, '5.0'
pod 'REActivityViewController', '~> 1.5.3'


Install into your Xcode project:
$ pod install


自动找依赖包,CocoaPods很好很强大!

Add #include "REActivityViewController.h" to the top of classes that will use it.

Manual installation

REActivityViewController needs to be linked with the following frameworks:

QuartzCore
AssetsLibrary
MessageUI
Twitter
The following framework must be added as optional (weak reference):
Social

加载Framework的时候要注意:
依赖包也需要添加额外的Framework,所以不要以为添加上述Framework后组件就可以正常使用了

需要添加的Framework还包括:
Accounts,Security,sqlite3,CoreLocation, AdSupport

Dependencies:

AFNetworking ~> 1.1
Facebook-iOS-SDK ~> 3.2
DEFacebookComposeViewController ~> 1.0.0
REComposeViewController ~> 2.0
PocketAPI ~> 1.0.2
SFHFKeychainUtils ~> 0.0.1
AFXAuthClient ~> 1.0.5






    
[3] 怎么使用 Adapter
    来源: 互联网  发布时间: 2014-02-18
如何使用 Adapter
Adapter 是listView和数据源之间的中间人



 

最简单的方法, 最慢最不实用:
public View getView(int pos, View convertView, ViewGroup parent) {
View item = mInflater.inflate(R.layout.list_item, null);
((TextView) item.findViewById(R.id.text)).setText(DATA[pos]);
((ImageView) item.findViewButId(R.id.icon))
.setImageBitmap((pos & 1) == 1 ? mIcon1 : mIcon2);
return item;
}

 

利用 convertView 回收视图, 效率提高 200%:
public View getView(int pos, View convertView, 
        ViewGroup parent){
    if (convertView == null) {
        convertView = mInflater.inflate(
                R.layout.list_item, null);
    }
    ((TextView) convertView.findViewById(R.id.text)).
            setText(DATA[pos]);
    ((ImageView) convertView.findViewButId(R.id.icon)).
            setImageBitmap((pos & 1) == 1 ? mIcon1 : mIcon2);

    return convertView;
}

 

使用 ViewHolder 模式, 效率再提高 50%:
static class ViewHolder {
    TextView text;
    ImageView icon;
}



public View getView(int pos, View convertView, ViewGroup parent){
    ViewHolder holder;
    if (convertView == null) {
        convertView = mInflater.inflate(R.layout.list_item, null);
        holder = new ViewHolder(); 
        holder.text = (TextView) convertView.findViewById(
                R.id.text));
        holder.icon = (ImageView) convertView.findViewButId(
                R.id.icon));
        convertView.setTag(holder);
    } else {
        holder = (ViewHolder) convertView.getTag();
    } 
    holder.text.setText(DATA[pos]);
    holder.icon.setImageBitmap((pos & 1) == 1 ? mIcon1 : mIcon2);
 

 


    
最新技术文章:
▪Android开发之登录验证实例教程
▪Android开发之注册登录方法示例
▪Android获取手机SIM卡运营商信息的方法
▪Android实现将已发送的短信写入短信数据库的...
▪Android发送短信功能代码
▪Android根据电话号码获得联系人头像实例代码
▪Android中GPS定位的用法实例
▪Android实现退出时关闭所有Activity的方法
▪Android实现文件的分割和组装
▪Android录音应用实例教程
▪Android双击返回键退出程序的实现方法
▪Android实现侦听电池状态显示、电量及充电动...
▪Android获取当前已连接的wifi信号强度的方法
▪Android实现动态显示或隐藏密码输入框的内容
▪根据USER-AGENT判断手机类型并跳转到相应的app...
▪Android Touch事件分发过程详解
▪Android中实现为TextView添加多个可点击的文本
▪Android程序设计之AIDL实例详解
▪Android显式启动与隐式启动Activity的区别介绍
▪Android按钮单击事件的四种常用写法总结
▪Android消息处理机制Looper和Handler详解
▪Android实现Back功能代码片段总结
▪Android实用的代码片段 常用代码总结
▪Android实现弹出键盘的方法
▪Android中通过view方式获取当前Activity的屏幕截...
▪Android提高之自定义Menu(TabMenu)实现方法
▪Android提高之多方向抽屉实现方法
▪Android提高之MediaPlayer播放网络音频的实现方法...
▪Android提高之MediaPlayer播放网络视频的实现方法...
▪Android提高之手游转电视游戏的模拟操控
 


站内导航:


特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

©2012-2021,,E-mail:www_#163.com(请将#改为@)

浙ICP备11055608号-3