小编Kol*_*ley的帖子

如何将UISearchBar图标更改为自定义图像?

目前,我有默认的放大镜作为我的搜索栏图标.但是,我想在其位置放置自定义图像,尤其是此图像:

自定义箭头图标

屏幕截图

如何将搜索栏默认图标更改为自定义图像?

customization icons uisearchbar ios swift

9
推荐指数
2
解决办法
7643
查看次数

如何让UIButton成为一个圆圈?

我一直试图让细胞中的UIButton成为一个完美的圆圈.不幸的是,圆形是基于背景图像而不是UIButton框架形成的.

我创建圆圈的代码:

cell.StoryViewButton.setImage(image, forState: .Normal)
cell.StoryViewButton.frame = CGRectMake(50, 8, 100, 100)
cell.StoryViewButton.layer.masksToBounds = false
cell.StoryViewButton.layer.cornerRadius = cell.StoryViewButton.frame.width/2
cell.StoryViewButton.clipsToBounds = true
Run Code Online (Sandbox Code Playgroud)

输出如下所示: 每个单元格的输出图像

我该怎么做才能得到我想要的完美圆形按钮框架?

uibutton uiimageview ios swift

8
推荐指数
2
解决办法
9478
查看次数

标签 统计

ios ×2

swift ×2

customization ×1

icons ×1

uibutton ×1

uiimageview ×1

uisearchbar ×1