nativescript-community / nativescript-community/ui-pager

iOS Layout issues using Label with maxLines

Open
#25 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
21
Forks
14
PR merge metrics
No merged PRs in 30d

Description

When using a Label with maxLines inside a pager's item, we see some layout issues on iOS. Sometimes, the Label's content is trimed to one line, even though it should be shown within two lines. And sometimes the Label is shown with a margin on the top.

https://user-images.githubusercontent.com/6443021/189871350-65f0eba1-10ca-4fc9-910c-d36cb8eca906.mov

<StackLayout className="pager-container">
        <Label text="My items" className="pager-header-title"/>

        <pager:Pager items="{{ items }}" className="pager">
            <pager:Pager.itemTemplate>
                <GridLayout rows="*" className="pager-item-outer">
                    <StackLayout row="0" padding="15">
                        <Label text="{{ title }}" maxLines="2" className="pager-item-title"/>
                        <!--<Label text="{{ subtitle }}" maxLines="2" className="pager-item-subtitle" marginTop="5"/>-->
                    </StackLayout>
                </GridLayout>
            </pager:Pager.itemTemplate>
        </pager:Pager>
</StackLayout>

Demo app to reproduce:
ns-ios-pager-issue.zip

We are thankful for any feedback!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the provided ns-ios-pager-issue.zip demo app and reproduce the Label maxLines behavior inside the pager item on iOS. Compare the one-line truncation and unexpected top margin with the expected two-line layout; done means the title consistently respects maxLines="2" without the extra top margin.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, typescript
Domain
mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.