- 浏览: 3912634 次
- 性别:
- 来自: 北京
-
最新评论
-
hinuliba:
...
字体背景颜色的高度修改 -
KANGOD:
最后的 -createDialog() 私有方法是怎么回事,没 ...
简单的实现listView中item多个控件以及点击事件 -
sswangqiao:
呵呵,呵呵
onActivityResult传值的使用 -
yumeiqiao:
感觉你所的不清楚 lstView.setOnTouchLi ...
listview中viewflipper的问题 -
lizhou828:
果然是大神啊!!!
Animation动画效果的实现
文章列表
swift中三种Singleton
- 博客分类:
- swift
全局变量
private let _SingletonSharedInstance = Singleton()
class Singleton {
class var sharedInstance : Singleton {
return _SingletonSharedInstance
}
}
嵌套
class Singleton {
class var sharedInstance : Singleton {
struct Static {
static let instance ...
swift 文档中没有涉及的方法
- 博客分类:
- swift
参看文档
http://practicalswift.com/2014/06/14/the-swift-standard-library-list-of-built-in-functions/
swift 简单总结
- 博客分类:
- iphone
http://kpbp.github.io/swiftcheatsheet/#constants
Swift is a new programming language for developing iOS and OS X apps that was introduced by Apple in June 2014.
Variables
var myInt = 1
var myExplicitInt: Int = 1 // explicit type
var x = 1, y = 2, z = 3 // declare multiple integers
myEx ...
如果ping一个网络是不是通,这里不是wifi,可以参看 http://www.splinter.com.au/how-to-ping-a-server-in-objective-c-iphone/
@Override
public void getHitRect(Rect outRect) {
super.getHitRect(outRect);
outRect.top+=getPaddingBottom()/2;
outRect.bottom-=getPaddingBottom()/2;
}
speex 和libogg 编译
- 博客分类:
- android
下载:
http://www.speex.org/downloads/
http://xiph.org/downloads/
建立 jni 文件夹,然后从下载的文件夹中提取相关文件 放到jni下
/libspeex/* ? /jni/libspeex/
/include/speex/* ? /jni/include/speex/
/src/wav_io.h ? /jni/include/speex
/src/* ? /jni/libogg/
/include/ogg/* ? /jni/include/ogg
编辑jni/include/speex/ ...
两台android 设备 进行rsync 同步
1。编译 rsync 源码
sudo apt-get install gcc-arm-linux-gnueabi
wget http://rsync.samba.org/ftp/rsync/rsync-3.1.0.tar.gz
tar -zxv -f rsync-3.1.0.tar.gz
cd rsync-3.1.0
./configure --host=arm-linux-gnueabi CFLAGS="-static"
make
2. ...
ubuntu 配置使用marven
- 博客分类:
- ubuntu
1.下载 http://maven.apache.org/download.cgi
2. 配置好 jdk 和marven路径
3. sudo gedit /etc/profile
最后添加
# set jdk environment
export JAVA_HOME=/home/wangpeng/work/jdk1.7.0_45
export JRE_HOME=/home/wangpeng/work/jdk1.7.0_45
export NDK_PATH=/home/wangpeng/work/android-ndk-r8b
export CLASS ...
public static String convertStreamToString(InputStream is) throws Exception
{
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
StringBuilder sb = new StringBuilder();
String line = null;
while ((line = reader.readLine()) != null) {
sb.append(line ...
java simplexml 序列化
- 博客分类:
- android
<?xml version="1.0" encoding="UTF-8"?>
<data>
<head>
<ver>协议版本</ver>
<dev_type>设备类型</dev_type>
<dev_sub_type>设备子类型</dev_sub_type>
<dev_sn>设备编号</dev_sn>
<cmd >命令字</cmd >
<id>消息i ...
获取其他程序的特定资源
- 博客分类:
- android
try
{
PackageManager manager = getPackageManager();
Resources resources = manager.getResourcesForApplication("com.example.packagename");
int resId = resources.getIdentifier("drawable_id", "drawable", "com.example.packagename");
Drawable ...
instancetype完成工厂模式
- 博客分类:
- iphone
@interface MONImage : UIImage
+ (instancetype)imageNamed:(NSString *)pName;
@end
@implementation MONImage
+ (instancetype)imageNamed:(NSString *)pName
{
UIImage * source = [UIImage imageNamed:pName];
CGImageRef cgImage = source.CGImage;
if (cgImage)
return [[self ...
检测来电属于哪个sim卡
- 博客分类:
- android
public class IncomingCallInterceptor extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
String callingSIM = "";
Bundle bundle = intent.getExtras();
callingSIM =String.valueOf(bundle.getInt("simId", -1));
if(call ...
ios7 去掉左侧空格
- 博客分类:
- iphone
UIBarButtonItem *homeButton = [[UIBarButtonItem alloc] initWithCustomView:segmentView];
UIBarButtonItem *negativeSpacer = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace
target:nil action:ni ...
使用 NDK r9 编译ffmpeg
- 博客分类:
- android
1. 环境 ubuntu 我的是13.10 ndk r9 64位
2. 下载ffmpeg http://www.ffmpeg.org/download.html 找到
FFmpeg 2.1.3 "Fourier"
2.1.3 was released on 2014-01-15. It is the latest stable FFmpeg release from the 2.1 release branch, which was cut from master on 2013-10-28. Amongst lots of other changes, it ...