Skip to content

Text will be horizontal centered if there is no heading - Is this the correct behaviour? #365

Closed Answered by yccheok
yccheok asked this question in Q&A
Discussion options

You must be logged in to vote

Sorry. I just notice that I can place .frame(maxWidth: .infinity, alignment: .leading) to make it work.

struct MarkdownView: View {
    @ObservedObject var viewModel: MarkdownViewModel

    var body: some View {
        Markdown {
            viewModel.markdownString
        }
        .frame(maxWidth: .infinity, alignment: .leading)
        .textSelection(.enabled)
        .markdownTheme(.gitHub)
    }
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by yccheok
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant