Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 89864

how to properly place view for all deviced

$
0
0

im having a problem placing a box view exactly on the middle of a line without it being cut off i will add picture so this makes sense and also imageview has gray rectangle behind it in the emulator



    <Grid RelativeLayout.HeightConstraint="{ConstraintExpression
        Type=RelativeToParent,
        Property=Height,
        Factor=.08}"
          RelativeLayout.WidthConstraint="{ConstraintExpression
        Type=RelativeToParent,
        Property=Width,
        Factor=1}"
             RelativeLayout.YConstraint="{ConstraintExpression
        Type=RelativeToView,
        ElementName=profileImage,
        Property=Height,
        Factor=.84

        }">
        <Grid.RowDefinitions>
            <RowDefinition Height="1*"/>

        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width=".2*"/>
            <ColumnDefinition Width=".2*"/>
            <ColumnDefinition Width=".2*"/>
            <ColumnDefinition Width=".2*"/>
            <ColumnDefinition Width=".2*"/>
        </Grid.ColumnDefinitions>
        <BoxView Grid.Row="0" Grid.Column="0"/>
        <Frame Grid.Row="0" Grid.Column="1"  Grid.ColumnSpan="3" BackgroundColor="#DCDCDC" HasShadow="False" CornerRadius="10" Padding="0" >
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="1*"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width=".33*"/>
                    <ColumnDefinition Width=".005*"/>
                    <ColumnDefinition Width=".33*"/>
                    <ColumnDefinition Width=".005*"/>
                    <ColumnDefinition Width=".33*"/>
                </Grid.ColumnDefinitions>
                <Grid Grid.Row="0" Grid.Column="0">
                    <Grid.RowDefinitions>
                        <RowDefinition Height=".6*"/>
                        <RowDefinition Height=".4*"/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="1*"/>
                    </Grid.ColumnDefinitions>
                    <Label Grid.Row="0" Grid.Column="0" Text="0" FontSize="25" HorizontalOptions="Center" VerticalOptions="Center"/>
                    <Label Grid.Row="1" Grid.Column="0"  Text="Following" FontSize="10" HorizontalOptions="Center" VerticalOptions="Center"/>
                </Grid>
                <Grid Grid.Row="0" Grid.Column="1">
                    <Grid.RowDefinitions>
                        <RowDefinition Height=".075*"/>
                        <RowDefinition Height=".85*"/>
                        <RowDefinition Height=".075*"/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="1*"/>
                    </Grid.ColumnDefinitions>
                    <BoxView Grid.Row="0" Grid.Column="0"/>
                    <BoxView Grid.Row="1" Grid.Column="0" BackgroundColor="#686868" />
                    <BoxView Grid.Row="2" Grid.Column="0"/>
                </Grid>
                <Grid  Grid.Row="0" Grid.Column="2" >
                    <Grid.RowDefinitions>
                        <RowDefinition Height=".6*"/>
                        <RowDefinition Height=".4*"/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="1*"/>
                    </Grid.ColumnDefinitions>
                    <Label Grid.Row="0" Grid.Column="0" Text="0" FontSize="25" HorizontalOptions="Center" VerticalOptions="Center"/>
                    <Label Grid.Row="1" Grid.Column="0"  Text="Following" FontSize="10" HorizontalOptions="Center" VerticalOptions="Center"/>
                </Grid>
                <Grid Grid.Row="0" Grid.Column="3" >
                    <Grid.RowDefinitions>
                        <RowDefinition Height=".075*"/>
                        <RowDefinition Height=".85*"/>
                        <RowDefinition Height=".075*"/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="1*"/>
                    </Grid.ColumnDefinitions>
                    <BoxView Grid.Row="0" Grid.Column="0"/>
                    <BoxView Grid.Row="1" Grid.Column="0" BackgroundColor="#686868"/>
                    <BoxView Grid.Row="2" Grid.Column="0"/>
                </Grid>
                <Grid  Grid.Row="0" Grid.Column="4">
                    <Grid.RowDefinitions>
                        <RowDefinition Height=".6*"/>
                        <RowDefinition Height=".4*"/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="1*"/>
                    </Grid.ColumnDefinitions>
                    <Label Grid.Row="0" Grid.Column="0" Text="0" FontSize="25" HorizontalOptions="Center" VerticalOptions="Center"/>
                    <Label Grid.Row="1" Grid.Column="0"  Text="Following" FontSize="10" HorizontalOptions="Center" VerticalOptions="Center"/>
                </Grid>

        </Grid>
        </Frame>

        <BoxView Grid.Row="0" Grid.Column="4"/>

    </Grid>





</RelativeLayout>


Viewing all articles
Browse latest Browse all 89864

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>