gpt4 book ai didi

ios - 在矩形绘图ios中输入字母

转载 作者:行者123 更新时间:2023-11-29 12:31:29 25 4
gpt4 key购买 nike

我正在绘制三个矩形以显示加载,但是我想在这些矩形中输入字母,我该如何在其中输入字母。

我的函数:

- (void)configUI {
self.backgroundColor = [UIColor clearColor];

UIView *rect1 = [self drawRectAtPosition:CGPointMake(0, 0)];
UIView *rect2 = [self drawRectAtPosition:CGPointMake(20, 0)];
UIView *rect3 = [self drawRectAtPosition:CGPointMake(40, 0)];

[self addSubview:rect1];
[self addSubview:rect2];
[self addSubview:rect3];

[self doAnimateCycleWithRects:@[rect1, rect2, rect3]];
}

我想在 rect1 中插入字母“A” , rect2 中的“B”和 rect3 中的“C” .

最佳答案

使用 UILabel 而不是 UIView。设置标签文本。 (请注意,UILabelUIView 一样具有背景颜色。)

关于ios - 在矩形绘图ios中输入字母,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27557187/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com