Nested TextView text is not aligned correctly as expected
See original GitHub issueProblem description
We create a TextView, position it in the right bound of its parent widget and don’t specify the width. Its size will be calculated according to the text size. Then we create another TextView that needs to be positioned between left bound and the previous TextView. In that case, the width of the right TextView is not calculated correctly.
Expected behavior
Create any widget between left bound and the right TextView must not affect to the width of the right TextView.
Environment
- Tabris.js version: 2.1
- Device: iPhone 6
- OS: iOS 11.0
Code snippet
import {Composite, TextView, ui} from 'tabris';
new Composite({class: 'container', left: 0, right: 0, centerY: 0}).append(
new TextView({
class: 'right',
text: 'Right text',
right: 0, top: 0,
background: 'rgba(255, 255, 0, 0.3)'
}),
new TextView({
class: 'left',
text: 'Left text',
left: 0, top: 0, right: ['.right', 8],
background: 'rgba(0, 255, 255, 0.3)'
})
).appendTo(ui.contentView);
It works as expected in Android:
The issue in iOS:
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Nested View and Text vertical alignment issue. #31955 - GitHub
Nesting View inside Text adds lineHeight's marginBottom to View and when we add Text inside that View it doesn't gets aligned properly.
Read more >Centering left-aligned-to-longest-TextView TextViews not ...
I want to create a layout where there are multiple lines with various lengths of text. All the texts are centered ...
Read more >TextView - Android Developers
android:gravity, Specifies how to align the text by the view's x- and/or y-axis ... Whether or not the auto handwriting initiation is enabled...
Read more >ConstraintLayout Tutorial for Android: Getting Started
Applying Alignment Constraints ... Select the Raze Galactic TextView and click on the right anchor and left anchor to delete those constraints.
Read more >Aligning Children using Flexbox in React Native - Modus Create
In this article, we learn how to align children in React Native. ... StyleSheet, Text, View, Component } = React; class ReactLayouts extends ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fixed in tabris-ios with a9491652142673e91c835426a59e6e268d5d05d9
However, I can reproduce the issue with Tabris.js
2.1.1
version.