Paul Mieczkowski
Paul Mieczkowski

Reputation: 168

why is UIFont.LineHeight read-only?

Any idea how to set line height in MonoTouch?

UIFont.LineHeight is read-only and has got no setter.

MonoTouch: 6.0.8

Upvotes: 2

Views: 2028

Answers (2)

olexa.le
olexa.le

Reputation: 1807

Some time ago I needed to change line spacing, but keep font size. Maybe this solution is a dirty hack, but it is simpler than writing your own UI components or use third-party libraries.

Upvotes: 0

poupou
poupou

Reputation: 43553

It's an Objective-C readonly property, see Apple documentation.

What you need to do is create a new UIFont instance, with a size that will match the line height you want, and assign (or use) that font instance in your code.

Upvotes: 2

Related Questions