Aligning a Frame in Xamarin Forms





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















How to modify the height of the Frame layout. I have tried to set the HeightRequest for the frame, but it doesnt work. Please check the below and attached image.



Frame



Frame frame = new Frame()
{
HasShadow = false,
Margin = new Thickness(10, 0, 0, 10),
BackgroundColor = Color.FromHex("#CDD0D1")
};


Label



 Label tag = new Label()
{
TextColor = Color.Black,
FontSize = 14,
};

frame.Content = tag;


enter image description here



Expected Output: My excepted output should be rectangle frame instead of square.










share|improve this question























  • What is the layout that your Frame is in?

    – SuavePirate
    Apr 7 '17 at 17:48











  • @SuavePirate I have used StackLayout in the Frame.

    – Parthiban
    Apr 8 '17 at 4:58











  • The layout you're putting your Frame in is most likely restricting the Frame itself. Can you post the implementation for this? Width and Height requests do work, so it's most likely the context you're using the Frame in.

    – Joshua Poling
    Apr 8 '17 at 20:34











  • xamarin frame take 20 padding my default you can change it to 0

    – Abdullah Tahan
    Jul 16 '17 at 8:01


















0















How to modify the height of the Frame layout. I have tried to set the HeightRequest for the frame, but it doesnt work. Please check the below and attached image.



Frame



Frame frame = new Frame()
{
HasShadow = false,
Margin = new Thickness(10, 0, 0, 10),
BackgroundColor = Color.FromHex("#CDD0D1")
};


Label



 Label tag = new Label()
{
TextColor = Color.Black,
FontSize = 14,
};

frame.Content = tag;


enter image description here



Expected Output: My excepted output should be rectangle frame instead of square.










share|improve this question























  • What is the layout that your Frame is in?

    – SuavePirate
    Apr 7 '17 at 17:48











  • @SuavePirate I have used StackLayout in the Frame.

    – Parthiban
    Apr 8 '17 at 4:58











  • The layout you're putting your Frame in is most likely restricting the Frame itself. Can you post the implementation for this? Width and Height requests do work, so it's most likely the context you're using the Frame in.

    – Joshua Poling
    Apr 8 '17 at 20:34











  • xamarin frame take 20 padding my default you can change it to 0

    – Abdullah Tahan
    Jul 16 '17 at 8:01














0












0








0








How to modify the height of the Frame layout. I have tried to set the HeightRequest for the frame, but it doesnt work. Please check the below and attached image.



Frame



Frame frame = new Frame()
{
HasShadow = false,
Margin = new Thickness(10, 0, 0, 10),
BackgroundColor = Color.FromHex("#CDD0D1")
};


Label



 Label tag = new Label()
{
TextColor = Color.Black,
FontSize = 14,
};

frame.Content = tag;


enter image description here



Expected Output: My excepted output should be rectangle frame instead of square.










share|improve this question














How to modify the height of the Frame layout. I have tried to set the HeightRequest for the frame, but it doesnt work. Please check the below and attached image.



Frame



Frame frame = new Frame()
{
HasShadow = false,
Margin = new Thickness(10, 0, 0, 10),
BackgroundColor = Color.FromHex("#CDD0D1")
};


Label



 Label tag = new Label()
{
TextColor = Color.Black,
FontSize = 14,
};

frame.Content = tag;


enter image description here



Expected Output: My excepted output should be rectangle frame instead of square.







xamarin xamarin.forms frame






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Apr 7 '17 at 17:25









ParthibanParthiban

909




909













  • What is the layout that your Frame is in?

    – SuavePirate
    Apr 7 '17 at 17:48











  • @SuavePirate I have used StackLayout in the Frame.

    – Parthiban
    Apr 8 '17 at 4:58











  • The layout you're putting your Frame in is most likely restricting the Frame itself. Can you post the implementation for this? Width and Height requests do work, so it's most likely the context you're using the Frame in.

    – Joshua Poling
    Apr 8 '17 at 20:34











  • xamarin frame take 20 padding my default you can change it to 0

    – Abdullah Tahan
    Jul 16 '17 at 8:01



















  • What is the layout that your Frame is in?

    – SuavePirate
    Apr 7 '17 at 17:48











  • @SuavePirate I have used StackLayout in the Frame.

    – Parthiban
    Apr 8 '17 at 4:58











  • The layout you're putting your Frame in is most likely restricting the Frame itself. Can you post the implementation for this? Width and Height requests do work, so it's most likely the context you're using the Frame in.

    – Joshua Poling
    Apr 8 '17 at 20:34











  • xamarin frame take 20 padding my default you can change it to 0

    – Abdullah Tahan
    Jul 16 '17 at 8:01

















What is the layout that your Frame is in?

– SuavePirate
Apr 7 '17 at 17:48





What is the layout that your Frame is in?

– SuavePirate
Apr 7 '17 at 17:48













@SuavePirate I have used StackLayout in the Frame.

– Parthiban
Apr 8 '17 at 4:58





@SuavePirate I have used StackLayout in the Frame.

– Parthiban
Apr 8 '17 at 4:58













The layout you're putting your Frame in is most likely restricting the Frame itself. Can you post the implementation for this? Width and Height requests do work, so it's most likely the context you're using the Frame in.

– Joshua Poling
Apr 8 '17 at 20:34





The layout you're putting your Frame in is most likely restricting the Frame itself. Can you post the implementation for this? Width and Height requests do work, so it's most likely the context you're using the Frame in.

– Joshua Poling
Apr 8 '17 at 20:34













xamarin frame take 20 padding my default you can change it to 0

– Abdullah Tahan
Jul 16 '17 at 8:01





xamarin frame take 20 padding my default you can change it to 0

– Abdullah Tahan
Jul 16 '17 at 8:01












1 Answer
1






active

oldest

votes


















0














Mainly,the frame control in Xamarin is take there own padding in all directions so add padding 0 of frame as:



Frame frame=new Frame{Padding=new Thickness(0)};





share|improve this answer


























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f43283888%2faligning-a-frame-in-xamarin-forms%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Mainly,the frame control in Xamarin is take there own padding in all directions so add padding 0 of frame as:



    Frame frame=new Frame{Padding=new Thickness(0)};





    share|improve this answer






























      0














      Mainly,the frame control in Xamarin is take there own padding in all directions so add padding 0 of frame as:



      Frame frame=new Frame{Padding=new Thickness(0)};





      share|improve this answer




























        0












        0








        0







        Mainly,the frame control in Xamarin is take there own padding in all directions so add padding 0 of frame as:



        Frame frame=new Frame{Padding=new Thickness(0)};





        share|improve this answer















        Mainly,the frame control in Xamarin is take there own padding in all directions so add padding 0 of frame as:



        Frame frame=new Frame{Padding=new Thickness(0)};






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 22 '18 at 9:59

























        answered Nov 22 '18 at 6:41









        SHUBHAM SHARMASHUBHAM SHARMA

        316




        316
































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f43283888%2faligning-a-frame-in-xamarin-forms%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            How to pass form data using jquery Ajax to insert data in database?

            National Museum of Racing and Hall of Fame

            Guess what letter conforming each word