Home > OS >  write text on a Line in xamarin.forms
write text on a Line in xamarin.forms

Time:09-22

i am trying to create something like this: enter image description here

so i wrote this code:

<?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="alphatrial.MainPage"
             BackgroundColor="#ffc40c">

    <StackLayout >
        <Label Text="ISC - Alpha" TextColor="Black" FontSize="Large" FontAttributes="Bold" FontFamily="MyAwesomeCustomFont" HorizontalOptions="End" Margin="0,50,20,0" />
        <Line Stroke="black" X1="0"  X2="340" StrokeThickness="2" />

        <Label Text="App" TextColor="White" FontSize="Large" FontAttributes="Bold" FontFamily="MyAwesomeCustomFont" HorizontalOptions="End" Margin="0,0,20,0"/>
    </StackLayout>

</ContentPage>

but i get this enter image description here i can't manage to get the words on the line directly. i don't want this space between the words and the line. what should i do? thanks in advance

CodePudding user response:

Take into account also the Padding and the Margins of the label.As for the layout spacing If that is not enough for you, you can even set a negative margin to overlap the components

  • Related