The design requirement is to put a label and a button on the image. The Image is in a DataTemplate of ListView. I want to use Absolute Layout. But it expand way out of the child element (image). So how to make the absolute layout the same size of the image. On the other hand if I use relative layout it also expands out of the child element. But it takes less space than absolute layout. I know Absolute Layout and RelativeLayout are the best for this scenario. But they were leaving lots of empty space between list view items. Please help me out and explain how to use both of these layouts appropriately in order to size them according to their child elements. The code is as follows
<ListView.ItemTemplate>
<AbsoluteLayout >
<Image Source="BuyersCard.png" > </Image>
<Label Text="{Binding Name}" AbsoluteLayout.LayoutFlags="PositionProportional" AbsoluteLayout.LayoutBounds=".1,.2"></Label>
<Button Text="Contact" BorderColor="Red" AbsoluteLayout.LayoutFlags="PositionProportional" AbsoluteLayout.LayoutBounds=".7,.2"></Button>
</AbsoluteLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>