question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HTML in dialog content

See original GitHub issue

How to use HTML in dialog content? Android dialogs support HTML by using Html.fromHtml - https://stackoverflow.com/a/14652941/1828637 - and it seems afollestad/material-dialogs does use Html.fromHtml - https://github.com/afollestad/material-dialogs/search?utf8=✓&q=fromHtml&type=

However doing this is not working:

const dialog = new DialogAndroid();
dialog.set({
    title: 'Testing HTML',
    content: 'html <br/><a href="#">link me</a>?',
    positiveText: 'OK',
    negativeText: 'Cancel'
})
dialog.show();

My goal is to create dialog like this with a drop down, which expands to second image:

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
vonovakcommented, Mar 28, 2018

@Noitidart we would probably need another parameter. content would stay the same, and we could add htmlContent which would use android.text.Html.fromHtml. If you create a PR for this, I will merge it; I do not need this functionality so I do not plan on working on this myself.

0reactions
Noitidartcommented, Mar 29, 2018

Any ideas how to use image in html? I scoured the afollstead repo issues but cant figure it out. Im not a native dev.

I did put my images into the drawable folder - myapp\android\app\src\main\res\drawable and then I did:

 <img src="emblem" />

Same as when we load native image to <Image> component - https://stackoverflow.com/a/45618210/1828637

But this is not working. Any ideas?

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Dialog element - HTML: HyperText Markup Language
The <dialog> HTML element represents a dialog box or other interactive component, such as a dismissible alert, inspector, or subwindow.
Read more >
HTML dialog Tag - W3Schools
The <dialog> tag defines a dialog box or subwindow. The <dialog> element makes it easy to create popup dialogs and modals on a...
Read more >
HTML <dialog> Tag - W3docs
The <dialog> tag is one of the HTML5 elements. It is used to create a native dialog box, with which the user interacts...
Read more >
Exploring HTML <dialog> element with examples
The dialog (widely known as a modal dialog) is a popup box on a web page. A dialog is also called a modal...
Read more >
Exploring the HTML Dialog element - Maya Shavin
header , which has the dialog title and a cancel button (with an X indicator) · main section where we display all the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found