Skip to content

[iOS] HtmlView padding is ignored #4358

Open

Description

@PeterStaev

On iOS the HtmlView padding is not being set at all. For example:

<HtmlView style="background-color: red; padding: 200;" 
html="<span style='background-color:green'>TEST</span>"/>

renders like:
screen shot 2017-06-12 at 4 45 10 pm

The HtmlView should implement the padding* properties like the TextView widget as well as set UITextVew.textContainer.lineFragmentPadding in order to eliminate the default left padding.


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

Activity

  1. tsonevn commented on Jun 13, 2017

    @tsonevn
    Contributor

    Hi @PeterStaev,
    Indeed there is an issue with adding the padding to the HtmlView for iOS. Setting up this property will not apply any changes to the view. I am attaching sample project, where this scenario could be reproduced.

    This issue is reproducible on NativeScript 3.0 as well as 2.5
    Archive.zip

  2. 7ammer commented on Apr 27, 2018

    @7ammer

    Any updates here?
    :L

  3. tsonevn commented on Apr 30, 2018

    @tsonevn
    Contributor

    Hi @7ammer,
    This issue is still under review.

  4. tsonevn commented on Jul 27, 2018

    @tsonevn
    Contributor

    The issue is still reproducible with NativeScript 4.1.
    Archive.zip

  5. fgutteridge commented on Nov 15, 2019

    @fgutteridge

    Still present in 6.1.2.

  6. ShobhitJain3040 commented on May 3, 2020

    @ShobhitJain3040

    I am using 6.4 and this issue is still there, any solutions?

  7. dondre commented on Oct 27, 2021

    @dondre

    I encountered this issue, it's annoying but if you make the background transparent it's easy to workaround.

    <StackLayout class="p-10">
    <HtmlView height="20%" class="m-10" backgroundColor="transparent" [html]="item.richText" />
    </StackLayout>
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions