直接上代码:/*
UISlider
*/ UISlider *slider = [[UISlider alloc] initWithFrame:CGRectMake(30, 300, CGRectGetWidth(self.view.bounds)- 60, 30)];
//设置滑杆 的最小值
slider.minimumValue = 0;...
分类:
其他好文 时间:
2015-07-14 11:45:31
阅读次数:
124
直接上代码:
// UIWindow *aWindow = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] ;
// self.window = aWindow ;
// [aWindow release] ;// 效果等同上述代码
// 当应用程序加载完成后,创建一个跟屏幕尺寸一样大的wind...
分类:
其他好文 时间:
2015-07-14 10:05:11
阅读次数:
116
直接上代码:/*
UILabel 使用
*/ UILabel *aLable = [[UILabel alloc] initWithFrame:self.window.bounds]; aLable.backgroundColor = [UIColor cyanColor];
//lable的text属性为NSString类型,是用来设置其要展示的文本内...
分类:
其他好文 时间:
2015-07-14 10:05:05
阅读次数:
82
首先创立 tableViewUITableView *tableView = [[UITableView alloc] initWithFrame:[UIScreen mainScreen].bounds style:UITableViewStyleGrouped]; [self addSubvi....
分类:
其他好文 时间:
2015-07-10 00:06:43
阅读次数:
195
创建 tableViewUITableViewStyle 有两种选择#pragma mark - 创建 tableView
- (void)createTableView
{
// 枚举类型共有两个
self.mainTableView = [[UITableView alloc] initWithFrame:[UIScreen mainScreen].bounds style:UI...
分类:
其他好文 时间:
2015-07-09 19:54:00
阅读次数:
104
小知识点:
bounds和frame的区别:
bounds:绝对坐标,以本身坐标系为参照,原点(0,0)
frame:相对坐标,以父视图的坐标系为参照,原点任意。
1.打开网址 http://open.weibo.com/
...
分类:
其他好文 时间:
2015-07-09 11:24:33
阅读次数:
97
首先创建UIWebView,这个不难,设置frame,然后添加到self.view上即可:
UIWebView *webView = [[UIWebView alloc] initWithFrame:self.view.bounds];
webView.scalesPageToFit = YES;//自动对页面进行缩放以适应屏幕
[self.view addSubview:webView];
...
分类:
移动开发 时间:
2015-07-09 11:23:33
阅读次数:
147
/* Capture the screenshot */ UIGraphicsBeginImageContextWithOptions(self.view.bounds.size, YES, 0.0f); if ([self.view drawViewHierarchyInRect:self.vie...
分类:
其他好文 时间:
2015-07-08 12:20:35
阅读次数:
115
1 #import "RootViewController.h" 2 3 #define width [UIScreen mainScreen].bounds.size.width 4 #define heigthY 150 5 #define scrollTime 1 6 7 ...
分类:
其他好文 时间:
2015-07-08 00:22:59
阅读次数:
163
1 /** 2 * 用来自定义imageView的尺寸和位置 (contentRect等于按钮的bounds) 3 */ 4 - (CGRect)imageRectForContentRect:(CGRect)contentRect { 5 return CGRectMake((co...
分类:
其他好文 时间:
2015-07-08 00:22:21
阅读次数:
146