Bug with TextView

fuse 1.3.0 14520 - MacOs 10.12.6

I reproduce a issue with TextView… In preview work fine when I write many break lines like:

But in my device (Samsung S8 Android 7) dont work and the Height of the TextView keep always the same like:

The code:

<App>
	<ScrollView>
		<StackPanel>
			<TextView TextColor="#000" Margin="0,20" Alignment="Top" CaretColor="#000" Focus.IsFocusable="true">
			    <WhilePressed>
			      <GiveFocus />
			    </WhilePressed>

			    <WhileFocused>
			        <Change Target="textInputRectangle.Width" Value="100%" Duration="0.5" Easing="ExponentialInOut" />
			    </WhileFocused>

			    <Rectangle Height="2." Width="0%" ux:Name="textInputRectangle" Alignment="BottomLeft" Margin="0,0,0,0" >
			        <SolidColor Color="#E21F1D" />
			    </Rectangle>

			    <Rectangle Height="2." Width="100%" Alignment="BottomLeft" >
			        <SolidColor Color="#aaa" />
			    </Rectangle>
			</TextView>
		</StackPanel>
	</ScrollView>
</App>

Tested this on my Nexus 5 with Android 6 and it works just fine. Can you do some more testing and confirm if this is an Android 7 (or a particular device) issue?

If I were to point out one thing, the root cause of the problem might be that the parent of your TextView is a StackPanel. A vertical StackPanel tries to be as little as possible in the vertical direction, so it may be constraining its children when they have no explicit height set.

I test it now on a Samsung S4 (Android 5.0.1) and I get the same bug!
How can I fix this? WHat alternative I have to achieve a similar result?

I need a TextView that the user can write large texts

As I suggested above, not putting it inside of a StackPanel would be one option.

If that for some reason isn’t possible, you will need to specify explicit dimensions with Height, MinHeight and MaxHeight.

I put a 200 of MinHeight and I have the same problem… I think is a bug.

I remove the StackPanel and I get the same bug in all my Android devices :frowning:

Sorry, but that last picture… it does not seem to be the same issue, does it? Can you post a complete example of the code you now have?

Here is the code and the bug in a video:

file

<App>
    <Panel>
    	<TextView TextColor="#000" Margin="0,20" Alignment="Top" CaretColor="#000" Focus.IsFocusable="true">
            <WhilePressed>
              <GiveFocus />
            </WhilePressed>

            <WhileFocused>
                <Change Target="textInputRectangle.Width" Value="100%" Duration="0.5" Easing="ExponentialInOut" />
            </WhileFocused>

            <Rectangle Height="2." Width="0%" ux:Name="textInputRectangle" Alignment="BottomLeft" Margin="0,0,0,0" >
                <SolidColor Color="#E21F1D" />
            </Rectangle>

            <Rectangle Height="2." Width="100%" Alignment="BottomLeft" >
                <SolidColor Color="#aaa" />
            </Rectangle>
        </TextView>
    </Panel>
</App>

That particular problem seen in the video seems to be fixable by simply adding TextWrapping="Wrap" to the TextView, like so:

<App>
    <Panel>
        <TextView TextColor="#000" Margin="20" Alignment="Top" CaretColor="#000" Focus.IsFocusable="true" TextWrapping="Wrap">
            <WhilePressed>
              <GiveFocus />
            </WhilePressed>

            <WhileFocused>
                <Change Target="textInputRectangle.Width" Value="100%" Duration="0.5" Easing="ExponentialInOut" />
            </WhileFocused>

            <Rectangle Height="2." Width="0%" ux:Name="textInputRectangle" Alignment="BottomLeft" Margin="0,0,0,0" >
                <SolidColor Color="#E21F1D" />
            </Rectangle>

            <Rectangle Height="2." Width="100%" Alignment="BottomLeft" >
                <SolidColor Color="#aaa" />
            </Rectangle>
        </TextView>
    </Panel>
</App>

Worked just fine on my Nexus 5 with Android 6 after the change.

Thanks! Problem solved! :slight_smile: