gpt4 book ai didi

ios - UITextView字体大小

转载 作者:行者123 更新时间:2023-11-30 14:06:33 24 4
gpt4 key购买 nike

我有一个空白/空的 UITextView,它将根据用户输入输出结果。一切都很顺利,但有一个小细节一直困扰着我——输出时的字体大小太小,不符合我的喜好!我尝试在 Storyboard的“属性检查器”中更改它,但只有当我决定在输出之前在框中包含文本时才会影响它。

到目前为止我的代码是

class FreePointViewController: UIViewController {

@IBOutlet weak var fpCoilSizeInput: UITextField!
@IBOutlet weak var fpCoilThicknessInput: UITextField!
@IBOutlet weak var fpLengthInput: UITextField!
@IBOutlet weak var fpPullForceInput: UITextField!
@IBOutlet weak var freePointResult: UITextView!

@IBAction func freePointButton(sender: AnyObject) {
var freePointConst:Double = 20684

calcFreePoint.freePointCoilSize = Double((fpCoilSizeInput.text as NSString).doubleValue)
calcFreePoint.freePointCoilThickness = Double((fpCoilThicknessInput.text as NSString).doubleValue)
calcFreePoint.freePointStretchPipe = Double((fpLengthInput.text as NSString).doubleValue)
calcFreePoint.freePointPullForce = Double((fpPullForceInput.text as NSString).doubleValue)

var freePointArea:Double = M_PI * (calcFreePoint.freePointCoilSize - calcFreePoint.freePointCoilThickness) * calcFreePoint.freePointCoilThickness

var freePoint = (freePointConst * calcFreePoint.freePointStretchPipe * freePointArea) / calcFreePoint.freePointPullForce

var freePointFormat = "0.2"

freePointResult.text = "The pipe is stuck at \(freePoint.format(freePointFormat)) meters"


}

我尝试在我的 freePointResult.text = ... 行上方添加类似 [textView setFont:[UIFont boldSystemFontOfSize:15]]; 的代码,但没有有效。

最佳答案

我找到了自己问题的答案...检查是否在 xib/Storyboard 属性检查器中选中了“可选”。如果不可选,则大小不会改变

关于ios - UITextView字体大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32321602/

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