摘要: 按钮点击调用//拍照按钮 UIButton *button5 = [UIButton buttonWithType:UIButtonTypeRoundedRect]; button5.frame = CGRectMake(50, 10, 220, 40); [button5 setTitle:@"拍照" forState:UIControlStateNormal]; [button5 addTarget:self action:@selector(pickPhotoFromCamera:) forControlEvents:UIControlEventTouchUpIn.. 阅读全文
posted @ 2012-11-19 14:00 TQ.CH 阅读(747) 评论(0) 推荐(0) 编辑
摘要: 以创建MyObject类对应的myobject表为例#import <Foundation/Foundation.h>#import <sqlite3.h>#import "MyObject.h"@interface DBCommon : NSObject{ id theDelegate; //声明数据库 sqlite3 *database; //是否第一次创建该数据库 BOOL firstCreate;}//打开数据库-(BOOL)open;//创建数据表MyObject-(BOOL)createTableMyObject:(sqlite3 *)d 阅读全文
posted @ 2012-11-19 13:50 TQ.CH 阅读(433) 评论(0) 推荐(0) 编辑
摘要: 从Documents目录下读取图片列表时,有加载延迟,界面有一个空白期。我想办法默认显示空图片占位(显示一个默认灰边图片),然后使用NSThread加载真正的图片UIImageView 添加在UIScrollView中 _myScrollView,3步走:for(int i=0;i<10;i++){ UIImageView *iv = [[UIImageViewalloc] initWithFrame:CGRectMake(0,i*110,320,300)]; iv.image = [UIImageimageNamed:@"defautlImage"]; [_mySc 阅读全文
posted @ 2012-11-19 13:33 TQ.CH 阅读(248) 评论(0) 推荐(0) 编辑
摘要: UIScrollView初始化://滚动视图 _myScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height - 44)]; _myScrollView.pagingEnabled = NO; //是否翻页 _myScrollView.showsVerticalScrollIndicator = NO;//不显示垂直方向的滚动条 _myScrollView.bounces = YES;/... 阅读全文
posted @ 2012-11-19 13:21 TQ.CH 阅读(796) 评论(0) 推荐(0) 编辑
摘要: #import <UIKit/UIKit.h>@interface AppDelegate : UIResponder <UIApplicationDelegate>@property (strong, nonatomic) UIWindow *window;@property (strong, nonatomic) UINavigationController *navigationController;@end@implementation AppDelegate@synthesize navigationController = _navigationContro 阅读全文
posted @ 2012-11-19 13:03 TQ.CH 阅读(259) 评论(0) 推荐(0) 编辑