Skip to content

Switch not visible with NS 3.0 on ios #4175

Closed

Description

@ivanbuhov

From @sebawita on May 12, 2017 15:22

When I use <Switch> with NS 3.0, the component doesn't get rendered on iOS (it does work fine on Android though), however there seems to be an empty space where the UI component should be.

  <Switch
    [(ngModel)]="profile.angularPro">
  </Switch>

However when I use horizontalAlignment="left" the component appears just fine.

  <Switch
    [(ngModel)]="profile.angularPro"
    class="switch"
    horizontalAlignment="left">
  </Switch>

Copied from original issue: NativeScript/ios-jsc#764

Activity

  1. added this to the milestone on May 15, 2017
  2. NickIliev commented on May 15, 2017

    @NickIliev
    Contributor

    @sebawita thanks for posting this issue - I can confirm that this is a reproducible bug for iOS with NativeScript 3.0.0. We will update the information here once we have released a fix.

    Reproduced with NativeScript 3.0.0 in both non-Angular (here) and Angular apps (here).

    For anyone interested, as a temporary workaround, use the solution provided by @sebawita by setting horizontalAlignment to left, center or right

  3. vchimev commented on May 16, 2017

    @vchimev
    Contributor

    This issue does not reproduce with {N} 2.5. Another workaround in 3.0 is to set width property.
    TODO: Update related test page by removing height and width properties when fixing the issue.

  4. toddanglin commented on May 17, 2017

    @toddanglin

    Can further confirm that setting the width style property to any value will make the Switch appear on iOS. So even settings width:1; will make the Switch appear as expected.

    For a "global" workaround 'til a patch is released, I think you should be able to do this in your app.css stylesheet using an element selector:

    Switch {
       width: 1;
    }
  5. self-assigned this
    on May 17, 2017
  6. 2 remaining items

  7. added and removed
    ready for testTSC needs to test this and confirm against live production apps and automated test suites
    on May 19, 2017
  8. removed their assignment
    on May 19, 2017
  9. SvetoslavTsenov commented on May 19, 2017

    @SvetoslavTsenov
    Contributor

    The fix is available in tns-core-modules@next

  10. modified the milestones: 3.0.1, 3.1 on May 22, 2017
  11. dtopuzov commented on May 22, 2017

    @dtopuzov
    Contributor

    Fix will be released in 3.0.1 later this week.

  12. lock commented on Aug 28, 2019

    @lock

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  13. locked and limited conversation to collaborators on Aug 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions