feat: 添加分享按钮图片资源和配置
- 在 Images.xcassets 中创建三个新的 Image Set: * shareWechat.imageset - 微信分享按钮图标 * shareQQ.imageset - QQ分享按钮图标 * shareDouyin.imageset - 抖音分享按钮图标 - 为每个 Image Set 配置 Contents.json,支持 @1x/@2x/@3x 多倍率 - 增强 SharePanel.m 按钮样式设置,添加可选的边框和阴影效果 - 添加详细的图片添加指南文档: * images_xcassets_guide.md - Images.xcassets 使用指南 * share_button_guide.md - 分享按钮设计规范 图片规格:60×60pt (@1x), 120×120pt (@2x), 180×180pt (@3x) 支持圆形按钮设计,代码自动处理圆角效果
This commit is contained in:
@@ -149,8 +149,21 @@ static SharePanel *sharedPanel = nil;
|
||||
CGFloat x = startX + index * (kButtonSize + kButtonMargin);
|
||||
button.frame = CGRectMake(x, kButtonTopMargin, kButtonSize, kButtonSize);
|
||||
[button setImage:[UIImage imageNamed:imageName] forState:UIControlStateNormal];
|
||||
|
||||
// 圆角设置
|
||||
button.layer.cornerRadius = kButtonSize / 2;
|
||||
button.clipsToBounds = YES;
|
||||
|
||||
// 可选:添加边框效果
|
||||
// button.layer.borderWidth = 1.0;
|
||||
// button.layer.borderColor = [UIColor colorWithWhite:0.9 alpha:1.0].CGColor;
|
||||
|
||||
// 可选:添加阴影效果(注意:阴影和clipsToBounds冲突,需要使用容器视图)
|
||||
// button.layer.shadowColor = [UIColor blackColor].CGColor;
|
||||
// button.layer.shadowOffset = CGSizeMake(0, 2);
|
||||
// button.layer.shadowOpacity = 0.1;
|
||||
// button.layer.shadowRadius = 4;
|
||||
|
||||
return button;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user