gpt4 book ai didi

iphone - 在 UIView 中绘制垂直线

转载 作者:可可西里 更新时间:2023-11-01 05:03:19 25 4
gpt4 key购买 nike

UIView * lineView = [[UIView alloc] initWithFrame:CGRectMake(0, dialogContainer.bounds.size.height - buttonHeight - buttonSpacerHeight, dialogContainer.bounds.size.width, buttonSpacerHeight)];
lineView.backgroundColor = [UIColor colorWithRed:198.0/255.0 green:198.0/255.0 blue:198.0/255.0 alpha:1.0f];
[dialogContainer addSubview:lineView];

我已经使用这段代码在 UIView 上绘制水平线。如何向 UIView 添加垂直线?

最佳答案

UIView * lineView = [[UIView alloc] initWithFrame:CGRectMake(dialogContainer.bounds.size.width/2, 0, buttonSpacerHeight, dialogContainer.bounds.size.height)];
lineView.backgroundColor = [UIColor colorWithRed:198.0/255.0 green:198.0/255.0 blue:198.0/255.0 alpha:1.0f];
[dialogContainer addSubview:lineView];

关于iphone - 在 UIView 中绘制垂直线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19263976/

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