NSMutableDictionary *normalAttrs = [NSMutableDictionary dictionary];
normalAttrs[NSFontAttributeName] = [UIFont systemFontOfSize:12];
normalAttrs[NSForegroundColorAttributeName] = [UIColor grayColor];
NSMutableDictionary *selectedAttrs = [NSMutableDictionary dictionary];
selectedAttrs[NSFontAttributeName] = [UIFont systemFontOfSize:12];
selectedAttrs[NSForegroundColorAttributeName] = [UIColor darkGrayColor];
UITabBarItem *item = [UITabBarItem appearance];
[item setTitleTextAttributes:normalAttrs forState:UIControlStateNormal];
[item setTitleTextAttributes:selectedAttrs forState:UIControlStateHighlighted];
- (void)layoutSubviews {
[super layoutSubviews];
self.publishButton.frame = CGRectMake(0, 0, self.publishButton.currentImage.size.width, self.publishButton.currentImage.size.height);
self.publishButton.center = CGPointMake(self.frame.size.width * 0.5, self.frame.size.height *0.5);
CGFloat buttonX;
CGFloat buttonY = 0;
CGFloat buttonW = self.frame.size.width / 5;
CGFloat buttonH = self.frame.size.height;
CGFloat index = 0;
for (UIView *button in self.subviews) {
// UITabBarController
if (![button isKindOfClass:NSClassFromString(@"UITabBarButton")]) continue;
// if (index > 1) {
// buttonX = ( index + 1 ) * buttonW;
// } else {
// buttonX = index * buttonW;
// }
buttonX = (index > 1) ? (index + 1) * buttonW : index * buttonW;
button.frame = CGRectMake(buttonX, buttonY, buttonW, buttonH);
index ++;
}
}// if (index > 1) {
// buttonX = ( index + 1 ) * buttonW;
// } else {
// buttonX = index * buttonW;
// }
// buttonX = (index > 1) ? (index + 1) * buttonW : index * buttonW;
buttonX = buttonW * ((index > 1)?(index + 1):index);
[self setValue:[[MyTabBar alloc] init] forKey:@"tabBar"];
1. contentSize 是scrollview可以滚动的区域,比如frame = (0 ,0 ,320 ,480) contentSize = (320 ,960),代表你的scrollview可以上下滚动,滚动区域为frame大小的两倍。
2. contentOffset 是scrollview当前显示区域顶点相对于frame顶点的偏移量(向屏幕内拉,偏移量是负值。向屏幕外推,偏移量是正数),比如上个例子,从初始状态向下拉50像素,contentoffset就是(0 ,-50),从初始状态向上推tableview100像素,contentOffset就是(0 ,100)。
3. contentInset 是scrollview的contentview的顶点相对于scrollview的位置,例如你的contentInset = (0 ,100),那么你的contentview就是从scrollview的(0 ,100)开始显示.
NSUXMLParser SAX 大文件
1 打开文档
2 开始查找起始标签
<dataSet>
<diffgr:diffgram>
<trainDetailInfo>
3 获取标签内容
4 查找结束标签
5 查询文档结束
$(SRCROOT)/百思不得姐/PrefixHeader.pch
json 数据解析
WLLRecommendedViewController *model = [[WLLRecommendedViewController alloc] init];
self.dataLeftList = [WLLModelRecommended objectArrayWithKeyValuesArray:responseObject[@"list"]];
// NSLog(@"%@", self.dataLeftList);
//
// for (WLLModelRecommended *model in self.dataLeftList) {
// NSLog(@"%@",model.id);
// NSLog(@"%@",model.name);
// NSLog(@"%@",@(model.count));
// }
[self.leftTableView registerNib:[UINib nibWithNibName:NSStringFromClass([WLLLeftFriendTrendTableViewCell class]) bundle:nil] forCellReuseIdentifier:leftIdentifer];
百思
最新推荐文章于 2020-07-30 22:11:22 发布