相关疑难解决方法(0)

在Swift中用纯色创建UIImage

我想以编程方式创建一个由纯色填充的UIImage.任何人都知道如何在Swift中执行此操作?

uiimage ios swift

122
推荐指数
9
解决办法
8万
查看次数

如何从分段控件中删除边框

如何删除分段控件的外边框?我已经将分频器图像设置为我想要的但现在要按照我的应用程序的模拟我需要一个没有外边框的分段控件.

uisegmentedcontrol ios swift

19
推荐指数
3
解决办法
2万
查看次数

如何在Swift中更改UISegmentedControl的选定段tintColor

我想在Swift 3中更改UISegmentedControl所选段的tintColor。我在Objective-c中搜索了很多答案。
这是我的代码:

class ViewController:UIViewController{

var segment:UISegmentedControl

override func viewDidLoad() {
super.viewDidLoad()

segment.insertSegment(withTitle: "AAA", at: 0, animated: true)
segment.insertSegment(withTitle: "BBB", at: 1, animated: true)
segment.insertSegment(withTitle: "CCC", at: 2, animated: true)

segment.addTarget(self, action: #selector(changeValue), for: .valueChanged)
segment.selectedSegmentIndex = 0

view.addSubview(segment)

}
  func changeValue(sender:AnyObject) {

  //I don't know how to do that change color when segment selected
  // 

}

}
Run Code Online (Sandbox Code Playgroud)

谢谢!

iphone uisegmentedcontrol ios swift

5
推荐指数
3
解决办法
8792
查看次数

标签 统计

ios ×3

swift ×3

uisegmentedcontrol ×2

iphone ×1

uiimage ×1