Bug 42528 - ViewCell In TableView does not align properly
Summary: ViewCell In TableView does not align properly
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 2.2.0
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2016-07-13 16:22 UTC by Ray Kelly
Modified: 2017-12-19 17:05 UTC (History)
5 users (show)

Tags: ac
Is this bug a regression?: ---
Last known good build:

Screenshot (74.96 KB, image/png)
2016-07-13 16:22 UTC, Ray Kelly

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report for Bug 42528 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description Ray Kelly 2016-07-13 16:22:45 UTC
Created attachment 16650 [details]

When using a view cell inside of a table, the laft margin does not line up on Android.   XML:
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
    <TableView Intent="Settings" Margin="10,0,10,0">
        <TableSection Title="Add/Edit Server">
          <EntryCell x:Name="entryServerName" Label="Server Name" Placeholder="My cool server" Text="{Binding ServerName}" />
          <EntryCell x:Name="entryServerAddress" Label="Server Address" Placeholder="minechat.town" Text="{Binding FullAddress}" Keyboard="Url" />
              <StackLayout Orientation="Horizontal" Padding="0,0,0,0">
                <Label VerticalOptions="Center" HorizontalOptions="StartAndExpand" Text="Minecraft Version"/>
                <Picker VerticalOptions="Center" x:Name="pickerVersion" SelectedIndex="{Binding ServerVersion}">
                    <x:String>Automatic (Recommended)</x:String>
          <SwitchCell x:Name="switchIsOffline" On="{Binding UseOffline}" Text="Offline/Cracked" />          

Screenshot attached, you can see "Minecraft Version" is not lined up with the other entry cells.  Android is on the left and you can see Windows on the right lined up properly.
Comment 1 Ray Kelly 2016-08-22 15:36:33 UTC
It is also misaligned on iOS.  It only works properly on Windows platforms.
Comment 2 Dimitar Dobrev 2017-10-31 15:05:17 UTC
I can see this bug now too, at least on iOS. As soon as a text cell is replaced with a view cell, the content sticks to the left edge of the container. Please fix it - it has been more than a year. The only workaround requires manually setting the margin which is different per platform, device, density and so on which makes it unacceptable.
Comment 3 Dimitar Dobrev 2017-10-31 15:07:33 UTC
I almost forgot to specify that the bug occurs with your latest version of too.
Comment 4 Dimitar Dobrev 2017-11-07 22:32:49 UTC
Please, at least comment on this one. If you cannot fix it, you could provide some guidance for users to send a pull.
Comment 5 James Cooke 2017-12-19 17:05:07 UTC
I think I'm getting the same. This basic example has nice padding around the EntryCell, but nothing around the ViewCell. I'd use an EntryCell for my Password, if you added 'IsPassword' to it :)

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
            <TableView Intent="Form" HasUnevenRows="False">
                    <TableSection Title="Login">
                        <EntryCell x:Name="Email"  Keyboard="Email" Placeholder="Email" />
                            <Entry x:Name="Password" Keyboard="Text" Placeholder="Password" IsPassword="True" />
            <Button Text="Click to Login" Clicked="Button_Clicked"/>