aminly 最近的时间轴更新
aminly

aminly

V2EX 第 130768 号会员,加入于 2015-08-05 10:07:16 +08:00
aminly 最近回复了
2015-08-05 12:42:32 +08:00
回复了 xiaobetty 创建的主题 推广 晒出你最蠢的一段代码,送 Cherry 鼠标垫
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];
}
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3565 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 13ms · UTC 04:45 · PVG 12:45 · LAX 20:45 · JFK 23:45
Developed with CodeLauncher
♥ Do have faith in what you're doing.