Bug 42528 - ViewCell In TableView does not align properly
Summary: ViewCell In TableView does not align properly
Status: CONFIRMED
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 2.2.0
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
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:


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


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:
Status:
CONFIRMED

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

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"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="MineChatForms.ServerAddPage"
             Title="Server">
  <ContentPage.Content>
    <TableView Intent="Settings" Margin="10,0,10,0">
      <TableRoot>
        <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" />
          <ViewCell>
              <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}">
                  <Picker.Items>
                    <x:String>Automatic (Recommended)</x:String>
                    <x:String>1.7</x:String>
                    <x:String>1.8</x:String>
                    <x:String>1.9/1.9.2</x:String>
                    <x:String>1.9.4</x:String>
                    <x:String>1.10</x:String>
                  </Picker.Items>
                </Picker>
              </StackLayout>
          </ViewCell>
          <SwitchCell x:Name="switchIsOffline" On="{Binding UseOffline}" Text="Offline/Cracked" />          
        </TableSection>
      </TableRoot>
    </TableView>
  </ContentPage.Content>
</ContentPage>


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 2.4.0.38779 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"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="myApp.LoginPage">
    <ContentPage.Content>
        <StackLayout>
            <TableView Intent="Form" HasUnevenRows="False">
                <TableRoot>
                    <TableSection Title="Login">
                        <EntryCell x:Name="Email"  Keyboard="Email" Placeholder="Email" />
                        <ViewCell>
                            <Entry x:Name="Password" Keyboard="Text" Placeholder="Password" IsPassword="True" />
                        </ViewCell>
                    </TableSection>
                </TableRoot>
            </TableView>
            
            <Button Text="Click to Login" Clicked="Button_Clicked"/>
        </StackLayout>
    </ContentPage.Content>
</ContentPage>