百思


    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];
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值