摘要: #import "WhiteBoardView.h"@implementation WhiteBoardView- (id)initWithFrame:(CGRect)frame { //1 if (self = [super initWithFrame:frame]) { //2 self.backgroundColor = [UIColor clearColor]; //3 self.opaque=0.5; CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); whiteBoardContext = CG 阅读全文
posted @ 2013-01-08 16:05 郑文亮 阅读(1627) 评论(0) 推荐(0) 编辑
摘要: iOS开发_iphone开发_iphone界面如何实现下拉列表代码如下: #import <UIKit/UIKit.h>@interface DropDownList : UIView<UITableViewDelegate,UITableViewDataSource> {UITextField* textField; //文本输入框NSArray* list; //下拉列表数据BOOL showList; //是否弹出下拉列表UITableView* listView; //下拉列表CGRect oldFrame,newFrame; //整个控件(包括下拉前和下拉.. 阅读全文
posted @ 2013-01-08 14:31 郑文亮 阅读(566) 评论(1) 推荐(1) 编辑
摘要: 因为种种原因,需要在iphone应用中实现图片查看功能,由于iphone屏幕支持多点触摸,于是是想到用“手势”来实现图片的实时缩放和移动。借鉴无所不在的internet网络资料之后,终于实现此一功能,过程如下。一、首先实现原图显示(不缩放)新建MoveScaleImageView类,继承uiview。用于加载一个UIImage。它有两个主要的成员,一个UIImage对象用于指定一个内存图片,一个UIImageView控件用于显示图片。@interface MoveScaleImageView : UIView{UIImage* originImage;UIImageView* imageVie 阅读全文
posted @ 2013-01-08 11:23 郑文亮 阅读(409) 评论(0) 推荐(0) 编辑
摘要: iphone图片等比缩放UIImage *img = imgView.image;int h = img.size.height;int w = img.size.width;if(h <= 320 && w <= 480){imgView.image = img;}else{float b = (float)320/w < (float)480/h ? (float)320/w : (float)480/h;CGSize itemSize = CGSizeMake(b*w, b*h);UIGraphicsBeginImageContext(itemSize) 阅读全文
posted @ 2013-01-08 11:15 郑文亮 阅读(258) 评论(0) 推荐(0) 编辑
摘要: 论坛里经常有朋友会问Crash的问题。Crash最多的无非就两种,一种就是signal SIGABRT,大概的意思就是发送Message出现问题,信号迷失了。这种的Crash其实是很好定位,Crash了后直接看Console里出的最后日志,比如这段:12012-03-28 19:26:33.055 TableViewMenuDemo[3916:f803] *** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[__NSArrayI replaceObjectAtIndex:wi 阅读全文
posted @ 2013-01-08 10:23 郑文亮 阅读(1507) 评论(1) 推荐(0) 编辑
摘要: 1.状态栏状态栏一般高度为20像素,在打手机或者显示消息时会放大到40像素高,注意,两倍高度的状态栏在好像只能在纵向的模式下使用。如下图用户可以隐藏状态栏,也可以将状态栏设置为灰色,黑色或者半透明的黑色。如果需要隐藏状态栏可以使用调用:[[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO];或者在应用程序文件Info.plist中将UIStatusBarHidden键设为ture。2.导航栏在纵向模式下导航栏为44像素高,在横向模式下为32像素高,导航栏提供了一个很少用的提示模式,该模式将高度扩展了30像素, 阅读全文
posted @ 2013-01-08 09:38 郑文亮 阅读(3008) 评论(2) 推荐(0) 编辑