How to programmatically add a line of space in between paragraphs in a UITextView?

ios swift uitextview

85 просмотра

1 ответ

1475 Репутация автора

I tried using /n after each paragraph like so:

"THE COZY, INVITING FEEL OF A CENTURIES-OLD EUROPEAN GATHERING SPOT INSPIRES THE PLACE.\n Creating a space from hand with dark wood interiors and eclectic old world accents, the husband and wife duo behind the Grail (as our loyalists, call us) brought a little bit of their ancestral heritage to design an authentic tavern amongst West Plano’s suburban landscape.\n

but this is what it looks like:

current

I am trying to make it look like this:

enter image description here

Автор: SwiftyJD Источник Размещён: 18.07.2016 05:58

Ответы (1)


0 плюса

2355 Репутация автора

Решение

Using one more \n (i.e. \n\n) will have the effect you want:

textView.text = "THE COZY, INVITING FEEL OF A CENTURIES-OLD EUROPEAN GATHERING SPOT INSPIRES THE PLACE.\n\n Creating a space from hand with dark wood interiors and eclectic old world accents, the husband and wife duo behind the Grail (as our loyalists, call us) brought a little bit of their ancestral heritage to design an authentic tavern amongst West Plano’s suburban landscape.\n"
Автор: Marcos Reboucas Размещён: 18.07.2016 06:15
Вопросы из категории :
32x32