Как заставить многострочный элемент ConfirmationDialog в SwiftUIIOS

Программируем под IOS
Ответить Пред. темаСлед. тема
Anonymous
 Как заставить многострочный элемент ConfirmationDialog в SwiftUI

Сообщение Anonymous »


I have a confirmation dialog with one entry being a bit too long to be display in a single line, so it gets cut in the middle:


Изображение


Nothing that I've tried has worked, I'm a bit out of ideas here.

Though there is one notable thing being that it is possible somehow: if I show the dialog, then increase the text size (from accessibility options) then at some point it will wrap around on multiple lines! And at this point if I keep the dialog open and I go back to a smaller text size, it will even stay on multiple lines, this being the result I would like initially. And of course if I close and reopen the dialog, it goes back to being single line and cut to fit


Изображение


Tried setting height with .frame(height:, also using .fixedSize(, but didn't work

Here is a small snippet to reproduce
import SwiftUI struct ConfirmationDialogTest: View { @State private var showDialog = false var body: some View { VStack { Button("Show dialog") { showDialog = true } } .confirmationDialog("Confirmation", isPresented: $showDialog) { Button("OK") {} Button("Very long text that will eventually be too long to be displayed on only one single line") {} Button("Delete", role: .destructive) {} } } }

Источник: https://stackoverflow.com/questions/780 ... in-swiftui
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «IOS»