Skip to content

HtmlView on iOS resets font on binding change #1268

@sitefinitysteve

Description

@sitefinitysteve

Okay so use this example:
https://gist.github.com/N3ll/f6c939539b6c0e0ae0e5

So basically any time you change the content bound to the html property, the font assigned gets reset...so need to keep re-calling this. I mean the UIFont is still there but what's in the view is reset to Times, and you need to re-call the .ios.font on it.

        var contentHtmlView = page.getViewById("contentHtmlView");
        contentHtmlView.ios.font = UIFont.fontWithNameSize(fontName,fontSize);

When I change the property bound to viewModel

<HtmlView id="contentHtmlView" html="{{ Content }}"  />

Video: http://www.screencast.com/t/0muA1wA5

Code in the click of the video is just this

exports.onChangeContent = function(args){
    var contentHtmlView = page.getViewById("contentHtmlView");

    viewModel.Content = "Changed: ios.font is " + contentHtmlView.ios.font;
}

by default on page load contentHtmlView.ios.font is null


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions