mansory
1.lable自适应高度
UILabel *lable = [[UILabel alloc]init];
lable.backgroundcolor = [uicolor whiteColor];
lable.text = @"是点击四个挤到佛教给对方加工件都构建偶家二极管日接口了大杀四方莱克斯顿,是发动机盖我几十个及地方机构我奇偶加尔文公祭日公积金都是类控件的房价高的";
lable.font = [UIFont systemFontOfSize:20];
lable.textColor = [UIColor redColor];
lable.numberOfLines = 0;
[scrollView addSubview:lable];
[lable mas_makeconstraints:^(MASconstraintMaker *make) {
make.left.right.equalTo(greenView);
make.top.equalTo(greenView.mas_bottom).offset(12);
}];
2.UIScrollView的contenSize自适应
UIScrollView *scrollView = [[UIScrollView alloc]init];
scrollView.backgroundColor = [UIColor lightGrayColor];
[self.view addSubview:scrollView];
UIView *contentView= [[UIView alloc]init];
contentView.backgroundColor = [UIColor orangeColor];
[scrollView addSubview:contentView];
UIView *redView = [[UIView alloc]init];
redView.backgroundColor = [UIColor redColor];
[scrollView addSubview: redView];
UIView *yeallowView = [[UIView alloc]init];
yeallowView.backgroundColor = [UIColor yellowColor];
[scrollView addSubview:yeallowView];
UIView *greenView = [[UIView alloc]init];
greenView.backgroundColor = [UIColor greenColor];
[scrollView addSubview:greenView];
UIView *lightView = [[UIView alloc]init];
lightView.backgroundColor = [UIColor lightGrayColor];
[scrollView addSubview:lightView];
[scrollView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.view);
}];
CGFloat padding = 25.0;
[greenView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.left.equalTo(scrollView).offset(padding);
make.size.mas_equalTo(CGSizeMake(250, 250));
}];
[redView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(greenView.mas_bottom).offset(padding);
make.left.equalTo(greenView.mas_right).offset(padding);
make.size.equalTo(greenView);
make.right.equalTo(scrollView).offset(-padding);
}];
[yeallowView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(scrollView).offset(padding);
make.top.equalTo(redView.mas_bottom).offset(padding);
make.size.equalTo(greenView);
make.bottom.equalTo(scrollView).offset(-padding);
}];
3.TableViewCell的自适应
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [UIColor whiteColor];
UITableView *tableView = [[UITableView alloc]initwithFrame:CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height) style:UITableViewStylePlain];
[tableView registerClass:[TestCell class] forCellReuseIdentifier:@"cell"];
tableView.delegate = self;
tableView.datasource =self;
tableView.rowHeight = UITableViewAutomaticDimension;
[self.view addSubview:tableView];
}
-(NSinteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return 20;
}
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
TestCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath];
return cell;
}
自定义cell里面的主要代码
UILabel *titleLb = [[UILabel alloc]init];
titleLb.textColor =[UIColor redColor];
titleLb.numberOfLines = 0;
titleLb.text = @"是都加哦我接发动is加都加个介绍的 就放商店防静电房管局死哦的几个我偶家死哦接我 我加个我我就都给我就是地方官基数低计算机那是块几点放圣诞节梵蒂冈我我就诶关键人物 ";
[self.contentView addSubview:titleLb];
[titleLb mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.contentView).offset(20);
make.right.equalTo(self.contentView).offset(30);
make.top.equalTo(self.contentView).offset(20);
make.bottom.equalTo(self.contentView).offset(-20);
}];
相关阅读
关于使用AD10进行拼版及放置mark点,V-cut标注全过程
首先吐槽一下炎热的天气,EMMMMM,搞得本求一整天都非常烦躁,加上这次工作本求第一次拼板,网上到处找资料,所以更加烦躁,所幸有强大的开
// MyThreadTimer.h#pragma once class MyThreadTimer : public CWinThread { DECLARE_MESSAGE_MAP() public: MyThre
注:(fpSpread1为farpoint名,fpSpread1_Sheet1为表名) 用farpoint的时,设置视区随滚动条移动(鼠标按着,farpoint的内容更新到滚动条的区域
专题相关文章:从内存可见性看Volatile、原子变量和CAS算法多线程并发之CountDownLatch(闭锁)使用详解多线程并发之显示锁Lock与其
1.先下载微PE和系统。 微PE:http://www.wepe.com.cn/download.html Win10专业版(永久激活,关闭更新,未精简,适合专业人士和高端玩家。