小编val*_*ale的帖子

如何更改 UIPageControl 点的边框?

更改颜色非常简单,但是否可以更改所有未选中点的边框?

前任:

dot.layer.borderWidth = 0.5 dot.layer.borderColor = UIColor.blackColor()

calayer uipagecontrol ios

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

塞特犬和盖特斯蟒蛇

我环顾四周,但我尝试的一切似乎都没有得到任何结果.我只需要为一个将数字转换为字符串而反之亦然的类设置自定义setter和getter.因为python不支持我使用字典.

class Ship(object):
    def __init__(self, type):
        self.fixed = define_direction()

        self.row = random_row(board, self)
        self.col = random_col(board, self)
        self.type = self.set_type(type)
        print "Type:", str(self.type)

    def set_type(self, type):
        return {
            0 : "Patrol boat",#2
            1 : "Destroyer",#3
            2 : "Submarine",#3
            3 : "Battleship",#4
            4 : "Aircraft carrier",#5
            }.get(type, "Patrol boat") 
    def get_type(self):
        return {
            "Patrol boat" : 0,#2
            "Destroyer" : 1,#3
            "Submarine" : 2,#3
            "Battleship" : 3,#4
            "Aircraft carrier" : 4,#5
              }.get(self.type, 0) 
    def __repr__(self):
        return "Ship. Type: ", self.get_type()
Run Code Online (Sandbox Code Playgroud)

不确定这self.type …

python python-2.7

3
推荐指数
1
解决办法
648
查看次数

标签 统计

calayer ×1

ios ×1

python ×1

python-2.7 ×1

uipagecontrol ×1