当前位置: 编程技术>移动开发
本页文章导读:
▪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
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:
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:
Edit your Podfile and add REActivityViewController:
Install into your Xcode project:
自动找依赖包,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
REActivityViewController
Out of the box activities include:
VKontakte
Tumblr (using XAuth)
Message
Open in Safari
Save to Pocket
Send to Instapaper
Save to Readability
Save to Diigo
Save to Kippt
Save to Album
Open in Maps
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
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);
最新技术文章: