Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Android] Force label text direction #2447

Closed
mhmd-azeez opened this issue Apr 12, 2018 · 5 comments
Closed

[Android] Force label text direction #2447

mhmd-azeez opened this issue Apr 12, 2018 · 5 comments
Assignees
Labels
a/label a/rtl help wanted We welcome community contributions to any issue, but these might be a good place to start! in-progress This issue has an associated pull request that may resolve it! p/Android proposal-accepted t/enhancement ➕ up-for-grabs We welcome community contributions to any issue, but these might be a good place to start!

Comments

@mhmd-azeez
Copy link

Description

Currently on Android FlowDirection has no effect on how text is aligned in Label. Which can be quite problematic especially when the Label is used inside ListView cells.

I am not sure if this is a bug, but I think that both iOS and Android projects should be consistent (according to @ali-h2010 Label on iOS respects FlowDirection). Aligning text based on its content is very useful in some cases, but we need to have more control over it.

Steps to Reproduce

  1. Create new project
  2. Add Two labels to a page
  3. Write English text in the first label and Kurdish/Arabic (نووسینی کوردی) text in the other
  4. Set Page FlowDirection to RightToLeft

Expected Behavior

The text of both labels should be aligned right.

Actual Behavior

The English text is still aligned left.

Basic Information

  • Version with issue:
  • Last known good version: N/A
  • IDE: Visual Studio 2017.6

Screenshots

img

919470c57e564540a10e4d163d4e4a34
Screenshot provided by: @ali-h2010

Reproduction Link

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:local="clr-namespace:App24"
             x:Class="App24.MainPage"
             Padding="10"
             FlowDirection="RightToLeft">

    <StackLayout>
        <Label Text="English Text" FontSize="Large" />
        <Label Text="نووسینی کوردی" FontSize="Large" />
    </StackLayout>
    
</ContentPage>

This is the full project: TextDirectionRepro.zip

@samhouts
Copy link
Member

This is listed as a known limitation on #1222: TextDirection property needs to be added. Thanks!

@samhouts samhouts added inactive Issue is older than 6 months and needs to be retested help wanted We welcome community contributions to any issue, but these might be a good place to start! up-for-grabs We welcome community contributions to any issue, but these might be a good place to start! labels Feb 14, 2020
@huangjinshe
Copy link

In the new releaset version of nuget, the problem still there.
My problem is more different, Looks like Android just auto handle the flwo direction by font content itselt.

For me, I never set the flow direction, because I need to always keep it : Left to right.
But when the label content change from English to Arabic, the label layout auto changed to right to left, I don't know how should I let it keep to left to right......

@samhouts samhouts removed the inactive Issue is older than 6 months and needs to be retested label Feb 24, 2020
memu8 added a commit that referenced this issue Jul 22, 2020
@samhouts samhouts added the in-progress This issue has an associated pull request that may resolve it! label Jul 30, 2020
memu8 added a commit that referenced this issue Jul 30, 2020
@huangjinshe
Copy link

@memu8 , @samhouts . What did you guys fixed in v4.8 ? I saw the issues still didn't fixed.

001
002

Currently problem is: Android will auto changing the text layout direction based on the current language. If the language direction is RTL, it still show the text from right to left(also the layout will based on that).
If you guys need a project support multiple languages and which include language direction LTR and RTL for test, use this: Oybab Trading System

@huangjinshe
Copy link

FlowDirection="LeftToRight" HorizontalOptions="FillAndExpand" not working BTW.

@memu8
Copy link
Contributor

memu8 commented Aug 10, 2020

@huangjinshe We fixed Labels, but this issue may still be present for Pickers and Entries. Can you please open a new issue for that? Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/label a/rtl help wanted We welcome community contributions to any issue, but these might be a good place to start! in-progress This issue has an associated pull request that may resolve it! p/Android proposal-accepted t/enhancement ➕ up-for-grabs We welcome community contributions to any issue, but these might be a good place to start!
Projects
None yet
Development

No branches or pull requests

4 participants