nativescript-checkbox icon indicating copy to clipboard operation
nativescript-checkbox copied to clipboard

Alignment issue in ios with text wrap

Open shrutisinghal opened this issue 7 years ago • 6 comments

I have 3-4 liner content with checkbox. In android it is working fine but in ios I am facing alignment issues. Is there any way I can fix it? screen shot 2018-02-08 at 6 53 41 pm

shrutisinghal avatar Feb 08 '18 13:02 shrutisinghal

hi @bradmartin i have a similar issue only on ios :

capture

        <StackLayout 
           class="p-10 list-group" 
           style="padding-top: 5" 
            *ngFor="let item of items" >
            <CheckBox 
                (loaded)="checkBoxLoaded($event)"
                class="list-group-item-text  m-l-10 p-4" 
                ios:font-size="20" 
                id="{{item.id}}" 
                [(ngModel)]="item.isSelected"  
                [text]="item.name" 
                [checked]="item.isSelected">
            </CheckBox>                
        </StackLayout>

the problem is due to this line ? : _this._iosCheckbox = BEMCheckBox.alloc().initWithFrame(CGRectMake(0, 0, 21, 21)); is there any way to extend it and center the x alignement ?

dali-gharbi avatar Mar 08 '18 08:03 dali-gharbi

Not entirely sure, have not had time to look into. Thanks for finding the line causing it. Let me know if anyone has any more info or wants to get a PR moving to help fix this.

bradmartin avatar Mar 21 '18 02:03 bradmartin

@bradmartin I had a problem similar to this one but for me the text is higher than the checkbox, not lower.

Removing the + 3 on this line https://github.com/nstudio/nativescript-checkbox/blob/master/checkbox.ios.ts#L203 seems to perfectly align the text with the checkbox. Why is there a + 3 ? Would you accept a PR to fix this ?

fthuin avatar Oct 22 '18 20:10 fthuin

Any pointer, facing same issue.

VimalKumarS avatar Apr 18 '19 04:04 VimalKumarS

Workaround is to use stacklayout and margin top.

<StackLayout orientation="horizontal">
    <CheckBox class="checkbox" ios:marginTop="15"></CheckBox>

    <Label text="My really long description that gets to multiline which affects the alignment of the checbox." textWrap="true"></Label>
</StackLayout>

seveneye avatar Jul 27 '19 07:07 seveneye

I have same problem as fthuin . text appearing higher than checkbox - using FlexboxLayout - but works in StackLayout.

Lelelo1 avatar Aug 27 '19 13:08 Lelelo1