如何垂直对齐AS3一个TextFieldTextField

由网友(青池゛旧时光ㄟ)分享简介:I'm尝试垂直对齐的单一险种文本字段在AS3中一些文字。不知道这是否可以用的TextFormat做,但我不这么认为。I´m trying to vertical align some text in a Monoline TextField in AS3.Not sure if this can be done...

I'm尝试垂直对齐的单一险种文本字段在AS3中一些文字。 不知道这是否可以用的TextFormat做,但我不这么认为。

I´m trying to vertical align some text in a Monoline TextField in AS3. Not sure if this can be done with TextFormat, but I don´t think so.

从来就找了一个解决方案,但没有真正的帮助。任何帮助是值得欢迎的。

I´ve looked for a solution but nothing really helpful. Any help is welcome.

谢谢!

推荐答案

您不能自动垂直对齐文本。你需要用你自己做出来。

You can't automatically vertical align text. You need to make it by your own.

这是我的工作code:

Here's my working code:

public static function verticalAlignTextField(tf: TextField): void {
    tf.y += Math.round((tf.height - tf.textHeight) / 2);
}
阅读全文

相关推荐

最新文章