for (int i =0 ; i<4; i++) {
UIButton *btn =[[UIButton alloc]init];
float ppx = ((kMainScreenWidth-15-40)-55)/4;
UILabel *title =[[UILabel alloc]init];
[title setFont:[UIFont systemFontOfSize:14]];
[title setTextColor:[UIColor colorWithHexString:@"#343434"]];
switch (i) {
case 0:
[btn setFrame:CGRectMake(15, self.LabelTitle.frame.origin.y+40,40,40)];
[title setFrame: CGRectMake(btn.frame.origin.x+btn.frame.size.width/2-12,btn.origin.y+btn.frame.size.width,24,20)];
[btn setBackgroundImage:[UIImage imageNamed:@"icon-qq"] forState:UIControlStateNormal];
[btn addTarget:self action:@selector(QQshareBtnClick:) forControlEvents:UIControlEventTouchUpInside];
title.text = @"QQ";
break;
case 1:
[btn setFrame:CGRectMake(ppx+55-9, self.LabelTitle.frame.origin.y+40,40,40)];
[title setFrame: CGRectMake(btn.frame.origin.x+btn.frame.size.width/2-15,btn.origin.y+btn.frame.size.width,30,20)];
[btn setBackgroundImage:[UIImage imageNamed:@"icon-msg"] forState:UIControlStateNormal];
[btn addTarget:self action:@selector(MSGshareBtnClick:) forControlEvents:UIControlEventTouchUpInside];
title.text = @"短息";
break;
case 2:
[btn setFrame:CGRectMake(kMainScreenWidth/2+ppx-40+9, self.LabelTitle.frame.origin.y+40,40,40)];
[title setFrame: CGRectMake(btn.frame.origin.x+btn.frame.size.width/2-15,btn.origin.y+btn.frame.size.width,30,20)];
[btn setBackgroundImage:[UIImage imageNamed:@"icon-wechat"] forState:UIControlStateNormal];
[btn addTarget:self action:@selector(WeChatshareBtnClick:) forControlEvents:UIControlEventTouchUpInside];
title.text = @"微信";
break;
case 3:
[btn setBackgroundImage:[UIImage imageNamed:@"icon-friendc"] forState:UIControlStateNormal];
[btn setFrame:CGRectMake(kMainScreenWidth-15-40, self.LabelTitle.frame.origin.y+40,40,40)];
[btn addTarget:self action:@selector(FriendCshareBtnClick:) forControlEvents:UIControlEventTouchUpInside];
title.text = @"朋友圈";
[title setFrame: CGRectMake(btn.frame.origin.x+btn.frame.size.width/2-22,btn.origin.y+btn.frame.size.width,45,20)];
break;
}
[self.shareView addSubview:title];
[self.shareView addSubview:btn];
}