小编PRA*_*MAR的帖子

目标c中的填埋场

我正在尝试着色应用程序并找出目标c中的任何人之前做过的填充物.???我正在读取图片中的所有像素数据,我也可以更改它..但是洪水填充只能做我想要的.. 示例图像..在这里我可以识别包含黑点的像素.但我真的很混淆如何识别特定白色区域中的像素.非常感谢...

iphone objective-c flood-fill

14
推荐指数
1
解决办法
3925
查看次数

如何为以下JSON数据创建模型类并解析它?

我的JSON数据

{
 "addon_items" : [
                     {
                      "aname" : "",
                      "id" : "2588",
                      "name" : "Plain Nan",
                      "order" : "1",
                      "aid" : "259",
                      "Sub_Add_Items" : "",
                      "icon" : "",
                      "status" : "1",
                      "next" : "0",
                      "price" : "0.60"
                     },
                     {
                      "aname" : "",
                      "id" : "2589",
                      "name" : "Pitta Bread",
                      "order" : "2",
                      "aid" : "259",
                      "Sub_Add_Items" : "",
                      "icon" : "",
                      "status" : "1",
                      "next" : "0",
                      "price" : "0.00"
                    }

                   ],

 "addon" : {
             "description" : "Please choose your …
Run Code Online (Sandbox Code Playgroud)

json swift alamofire swifty-json

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

如何快速动态创建单选按钮?

我有以下按钮,它们会根据某些条件动态添加。现在,我需要将所有添加的按钮行为更改为单选按钮。这样我就可以根据选择执行一些操作。

  var posX = 0
    var posY = 0

    if trim.contains("0"){
        print("contaim 0")
        let button1 = UIButton(frame: CGRect(x: posX, y: posY, width: 60, height: 20))
        button1.setTitleColor(UIColor.blackColor(), forState: .Normal)
        button1.setTitle("No", forState: .Normal)
        button1.setImage(UIImage(named: "checkbox untick.png")!, forState: .Normal)
        button1.addTarget(self, action: #selector(buttonAction), forControlEvents: .TouchUpInside)
        myStackview.addSubview(button1)
        posX = 60
    }
    if trim.contains("1") {
        print("contaim 1")

        let button2 = UIButton(frame: CGRect(x: posX, y: posY, width: 60, height: 20))
            button2.setTitleColor(UIColor.blackColor(), forState: .Normal)
            button2.setTitle("Less", forState: .Normal)
            button2.setImage(UIImage(named: "checkbox untick.png")!, forState: .Normal)
            button2.addTarget(self, action: #selector(buttonAction), forControlEvents: .TouchUpInside)
            myStackview.addSubview(button2) …
Run Code Online (Sandbox Code Playgroud)

radio-button ios swift

4
推荐指数
1
解决办法
2946
查看次数