Fork me on GitHub

文章分类 -  interface

上一页 1 2 3

界面控件
popover window on iphone (代码实现)
摘要:以前一直迷恋于iphone上的alertview,popoverwindow是怎么做的,也就是怎样再iphone上弹出不满屏显示的模态对话窗口。昨天搞放大镜时突然得到了灵感。今天sb回来(要自虐,去sb会)突然又想到这个事,就尝试了一下,成功了。这里分享下思路。其实一直以来我们都收到了一个惯性思维的影响,那就是 iphone的程序只有一个window,而且window是继承自view的,再加上IB里不可以创建window,所以一直把window这个东西给忽略掉了。其实目前那些popover的menu,loadingview之类的都是搞view,可以解决。但显示的时候其实挺麻烦的,得先保证全屏, 阅读全文

posted @ 2012-02-08 21:00 pengyingh 阅读(1239) 评论(0) 推荐(0) 编辑

IOS开发UI篇之──自定义加载等待框(MBProgressHUD)
摘要:这里介绍一下网友开源的MBProgressHUD类,实现等待框,一、网上下载 MBProgessHUD 类文件,直接导入到工程即可二、示例分析在我的工程中示例如下:1)在ShowImageViewController.h头文件代码如下:#import<UIKit/UIKit.h>#import"MBProgressHUD.h"@interfaceShowImageViewController :UIViewController<MBProgressHUDDelegate> { NSString *_picUrlString; UIImageView 阅读全文

posted @ 2012-02-08 20:41 pengyingh 阅读(5907) 评论(0) 推荐(0) 编辑

IOS开发UI篇之──自定义UIActionSheet
摘要:UIActionSheet类系IOS开发中实现警告框的重要的类,而在好多应用中,都对它进行了扩展,今天介绍一下自定义风格的UIActionSheet一、自定义CustomActionSheet类CustomActionSheet类继承UIActionSheet,具体的实现如下所示:1)CustomActionSheet.h头文件#import <Foundation/Foundation.h>@interface CustomActionSheet : UIActionSheet{UIToolbar* toolBar;UIView* view;}@property(nonatomi 阅读全文

posted @ 2012-02-08 20:40 pengyingh 阅读(16042) 评论(3) 推荐(0) 编辑

如何使用Core Text计算一段文本绘制在屏幕上之后的高度
摘要:Core Text提供了一系列方便的函数,可以很容易的把文本绘制在屏幕上,对于一个Frame来说,一般并不需要担心文本的排列问题,这些Core Text的函数都可以直接搞定,只要给他一个大小合适的CGRect就可以。但,在某些情况下,我们还希望知道这段文本在绘制之后,对应绘制的字体字号设置,在屏幕上实际占用了多大面积。举例来说,有文本段落a,屏幕大小rect,通常做法是以rect创建path,然后创建CTFramesetter,再然后创建CTFrame,最后用CTFrameDraw画出来,这时候,往往文本段落占用的实际面积会小于rect,这时候就有必要获得这段文本所占用的真正面积。最理想的情况 阅读全文

posted @ 2012-02-08 19:34 pengyingh 阅读(607) 评论(0) 推荐(0) 编辑

IOS利用Core Text对文字进行排版
摘要:原贴地址:http://hi.baidu.com/jwq359699768/blog/item/5df305c893413d0a7e3e6f7b.htmlcore text 这个包默认是没有的,要自己手动添加进来。在IOS中利用core text对文本进行排版的几个关键点如下: 字间距:kCTKernAttributeName 行间距:kCTParagraphStyleSpecifierLineSpacingAdjustment 或 kCTParagraphStyleSpecifierLineSpacing(不推荐使用) 段间距:kCTParagraphStyleSpecifierParagr 阅读全文

posted @ 2012-02-08 19:33 pengyingh 阅读(9591) 评论(0) 推荐(1) 编辑

IOS core text计算文本高度及最大宽度
摘要:转自:http://lists.apple.com/archives/quartz-dev/2008/Mar/msg00079.html- (CGSize) measureFrame: (CTFrameRef) frame forContext: (CGContext *) cgContext{//frame为排版后的文本CGPathRefframePath =CTFrameGetPath(frame);CGRectframeRect =CGPathGetBoundingBox(framePath);CFArrayReflines =CTFrameGetLines(frame);CFIndex 阅读全文

posted @ 2012-02-08 19:30 pengyingh 阅读(2792) 评论(0) 推荐(0) 编辑

在IOS程序中设置UIButton的字体大小
摘要:btn.frame=CGRectMake(x, y, width, height);[btnsetTitle:@"search"forState:UIControlStateNormal];//设置按钮上的自体的大小//[btn setFont: [UIFont systemFontSize: 14.0]];//这种可以用来设置字体的大小,但是可能会在将来的SDK版本中去除改方法//应该使用btn.titleLabel.font= [UIFontsystemFontOfSize:14.0];[btn seBackgroundColor: [UIColorblueColor] 阅读全文

posted @ 2012-02-08 18:48 pengyingh 阅读(31557) 评论(1) 推荐(0) 编辑

UIToolBar,UINavigationBar 修改背景色
摘要:UIToolBar 三种办法方法一/toolBarbackgroundimagesetbasedoniOSversion[[UIDevicecurrentDevice]systemVersion];if([[[UIDevicecurrentDevice]systemVersion]floatValue]>4.9){//iOS5UIImage*toolBarIMG=[UIImageimageNamed:@"toolBar_brown.png"];if([toolBarrespondsToSelector:@selector(setBackgroundImage:forT 阅读全文

posted @ 2012-02-07 22:08 pengyingh 阅读(2871) 评论(0) 推荐(0) 编辑

User Interface Customization in iOS 5(转载)
摘要:Note from Ray:Congratulations, you guys did it! By helping to spread the word about theiOS 5 Feast, you guys unlocked the first iOS 5 tutorial early! Enjoy!This is a blog post by iOS Tutorial Team memberSteve Baranski, the founder ofkomorka technology, a provider of iOS development and consulting se 阅读全文

posted @ 2012-02-06 09:09 pengyingh 阅读(622) 评论(0) 推荐(0) 编辑

上一页 1 2 3

导航