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

How do I make proper bullet points in a StackLayout class?

$
0
0

Someone suggested to use the StackLayout class to do bullets in my last post.

https://forums.xamarin.com/discussion/74420/what-is-the-best-way-to-format-text-in-xamarin-forms#latest

I am trying to do this, but when I do bullets, the text wraps around to the margin instead of to the right edge of the bullet like in Word documents. Example of a proper bullet:

  • Xamarin is a Microsoft-owned San Francisco, California-based software company founded in May 2011[3] by the engineers that created Mono,[4] Mono for Android and MonoTouch that are cross-platform implementations of the Common Language Infrastructure (CLI) and Common Language Specifications (often called Microsoft .NET).

This is what happens when I use my code.

• Xamarin is a Microsoft-owned San Francisco, California-based software company founded in May 2011[3] by the engineers that created Mono,[4] Mono for Android and MonoTouch that are cross-platform implementations of the Common Language Infrastructure (CLI) and Common Language Specifications (often called Microsoft .NET).

I have been experimenting with the BulletedList class, but it does not want to seem to want to fit in the main class. This is an example of the code I am using right now.

using System;
using Xamarin.Forms;

namespace FormsGallery
{

public class MyClass : ContentPage
{
    public MyClass()
    {
        Label header = new Label
        {
            Text = "MyClass",
            FontSize = 36,
            FontAttributes = FontAttributes.Bold,
            HorizontalOptions = LayoutOptions.Center
        };

        ScrollView scrollView = new ScrollView
        {

            Content = new StackLayout()
            {
                Spacing = 0,
                Padding = 0,
                VerticalOptions = LayoutOptions.FillAndExpand,
                Children = {

                        new Label
                        {

                        Margin = new Thickness (20),
                        FontSize = 16,
                        Text = "\u2022 Xamarin is a Microsoft-owned San Francisco, California-based software company founded in May 2011[3] by the engineers that created Mono,[4] Mono for Android and MonoTouch that are cross-platform implementations of the Common Language Infrastructure (CLI) and Common Language Specifications (often called Microsoft .NET).\n",

                    },

                        }
            }

        };

        // Build the page.

        this.Content = new StackLayout
        {
            Children =
            {
                header,
                scrollView,
            }
        };
    }
}

}


Viewing all articles
Browse latest Browse all 77050

Trending Articles



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