Unity: Button spacing differs at different screen resolutions










0















In my game (Unity 2017.3.1f1) I'm using a ScrollView that's filled with buttons at runtime.



At 1080p:



enter image description here



And at 1440p:



enter image description here



The blue dots show the constraints of the Content, the whole thing (including the grey part below) makes up the Scroll View. No matter how big/small I make the Content, the border doesn't vanish at 1440p but is instead resized with the Content.



  • The width of the ScrollView is set through a surrounding panel

  • The buttons all use the same pefab (Inspector: click) - 1st image below

  • The buttons are arranged by a Vertical Layout Group on the Content (Inspector: click) - 2nd image below

enter image description hereenter image description here



As you can see in the last screenshot, the Vertical Layout Group is set to force expand the button's width and control its size, which isn't set anywhere else. I also don't set any padding/spacing in the Vertical Layout Group and yet there's an empty space between the two buttons.



I want it to look the same at 1080p and 1440p. What am I missing?










share|improve this question
























  • @Draco18s I already did in the original post, it's the very last link (The buttons are arranged by a Vertical Layout Group on the Content (Inspector: click)) - I added the screenshots directly now too...

    – Neph
    Nov 14 '18 at 9:19












  • @Draco18s Do you know what setting of the vertical layout group causes this problem most likely?

    – Neph
    Nov 16 '18 at 12:46











  • No, I've messed with layout groups only enough to know that I hate them.

    – Draco18s
    Nov 16 '18 at 14:21











  • @Draco18s You said Its settings aren't sufficient but what exactly is missing? Any idea what I could try to fix it then (apart from getting rid of the layout group, which I can't do because I need the buttons to be sorted)?

    – Neph
    Nov 19 '18 at 11:45











  • When I said that you didn't have a screen shot of its inspector, showing all of its settings. Now you do (or at least, converted it from a link that I hadn't seen), so that comment is no longer relevant.

    – Draco18s
    Nov 19 '18 at 15:26
















0















In my game (Unity 2017.3.1f1) I'm using a ScrollView that's filled with buttons at runtime.



At 1080p:



enter image description here



And at 1440p:



enter image description here



The blue dots show the constraints of the Content, the whole thing (including the grey part below) makes up the Scroll View. No matter how big/small I make the Content, the border doesn't vanish at 1440p but is instead resized with the Content.



  • The width of the ScrollView is set through a surrounding panel

  • The buttons all use the same pefab (Inspector: click) - 1st image below

  • The buttons are arranged by a Vertical Layout Group on the Content (Inspector: click) - 2nd image below

enter image description hereenter image description here



As you can see in the last screenshot, the Vertical Layout Group is set to force expand the button's width and control its size, which isn't set anywhere else. I also don't set any padding/spacing in the Vertical Layout Group and yet there's an empty space between the two buttons.



I want it to look the same at 1080p and 1440p. What am I missing?










share|improve this question
























  • @Draco18s I already did in the original post, it's the very last link (The buttons are arranged by a Vertical Layout Group on the Content (Inspector: click)) - I added the screenshots directly now too...

    – Neph
    Nov 14 '18 at 9:19












  • @Draco18s Do you know what setting of the vertical layout group causes this problem most likely?

    – Neph
    Nov 16 '18 at 12:46











  • No, I've messed with layout groups only enough to know that I hate them.

    – Draco18s
    Nov 16 '18 at 14:21











  • @Draco18s You said Its settings aren't sufficient but what exactly is missing? Any idea what I could try to fix it then (apart from getting rid of the layout group, which I can't do because I need the buttons to be sorted)?

    – Neph
    Nov 19 '18 at 11:45











  • When I said that you didn't have a screen shot of its inspector, showing all of its settings. Now you do (or at least, converted it from a link that I hadn't seen), so that comment is no longer relevant.

    – Draco18s
    Nov 19 '18 at 15:26














0












0








0








In my game (Unity 2017.3.1f1) I'm using a ScrollView that's filled with buttons at runtime.



At 1080p:



enter image description here



And at 1440p:



enter image description here



The blue dots show the constraints of the Content, the whole thing (including the grey part below) makes up the Scroll View. No matter how big/small I make the Content, the border doesn't vanish at 1440p but is instead resized with the Content.



  • The width of the ScrollView is set through a surrounding panel

  • The buttons all use the same pefab (Inspector: click) - 1st image below

  • The buttons are arranged by a Vertical Layout Group on the Content (Inspector: click) - 2nd image below

enter image description hereenter image description here



As you can see in the last screenshot, the Vertical Layout Group is set to force expand the button's width and control its size, which isn't set anywhere else. I also don't set any padding/spacing in the Vertical Layout Group and yet there's an empty space between the two buttons.



I want it to look the same at 1080p and 1440p. What am I missing?










share|improve this question
















In my game (Unity 2017.3.1f1) I'm using a ScrollView that's filled with buttons at runtime.



At 1080p:



enter image description here



And at 1440p:



enter image description here



The blue dots show the constraints of the Content, the whole thing (including the grey part below) makes up the Scroll View. No matter how big/small I make the Content, the border doesn't vanish at 1440p but is instead resized with the Content.



  • The width of the ScrollView is set through a surrounding panel

  • The buttons all use the same pefab (Inspector: click) - 1st image below

  • The buttons are arranged by a Vertical Layout Group on the Content (Inspector: click) - 2nd image below

enter image description hereenter image description here



As you can see in the last screenshot, the Vertical Layout Group is set to force expand the button's width and control its size, which isn't set anywhere else. I also don't set any padding/spacing in the Vertical Layout Group and yet there's an empty space between the two buttons.



I want it to look the same at 1080p and 1440p. What am I missing?







unity3d button screen-resolution spacing






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 14 '18 at 9:23







Neph

















asked Nov 13 '18 at 16:19









NephNeph

1581117




1581117












  • @Draco18s I already did in the original post, it's the very last link (The buttons are arranged by a Vertical Layout Group on the Content (Inspector: click)) - I added the screenshots directly now too...

    – Neph
    Nov 14 '18 at 9:19












  • @Draco18s Do you know what setting of the vertical layout group causes this problem most likely?

    – Neph
    Nov 16 '18 at 12:46











  • No, I've messed with layout groups only enough to know that I hate them.

    – Draco18s
    Nov 16 '18 at 14:21











  • @Draco18s You said Its settings aren't sufficient but what exactly is missing? Any idea what I could try to fix it then (apart from getting rid of the layout group, which I can't do because I need the buttons to be sorted)?

    – Neph
    Nov 19 '18 at 11:45











  • When I said that you didn't have a screen shot of its inspector, showing all of its settings. Now you do (or at least, converted it from a link that I hadn't seen), so that comment is no longer relevant.

    – Draco18s
    Nov 19 '18 at 15:26


















  • @Draco18s I already did in the original post, it's the very last link (The buttons are arranged by a Vertical Layout Group on the Content (Inspector: click)) - I added the screenshots directly now too...

    – Neph
    Nov 14 '18 at 9:19












  • @Draco18s Do you know what setting of the vertical layout group causes this problem most likely?

    – Neph
    Nov 16 '18 at 12:46











  • No, I've messed with layout groups only enough to know that I hate them.

    – Draco18s
    Nov 16 '18 at 14:21











  • @Draco18s You said Its settings aren't sufficient but what exactly is missing? Any idea what I could try to fix it then (apart from getting rid of the layout group, which I can't do because I need the buttons to be sorted)?

    – Neph
    Nov 19 '18 at 11:45











  • When I said that you didn't have a screen shot of its inspector, showing all of its settings. Now you do (or at least, converted it from a link that I hadn't seen), so that comment is no longer relevant.

    – Draco18s
    Nov 19 '18 at 15:26

















@Draco18s I already did in the original post, it's the very last link (The buttons are arranged by a Vertical Layout Group on the Content (Inspector: click)) - I added the screenshots directly now too...

– Neph
Nov 14 '18 at 9:19






@Draco18s I already did in the original post, it's the very last link (The buttons are arranged by a Vertical Layout Group on the Content (Inspector: click)) - I added the screenshots directly now too...

– Neph
Nov 14 '18 at 9:19














@Draco18s Do you know what setting of the vertical layout group causes this problem most likely?

– Neph
Nov 16 '18 at 12:46





@Draco18s Do you know what setting of the vertical layout group causes this problem most likely?

– Neph
Nov 16 '18 at 12:46













No, I've messed with layout groups only enough to know that I hate them.

– Draco18s
Nov 16 '18 at 14:21





No, I've messed with layout groups only enough to know that I hate them.

– Draco18s
Nov 16 '18 at 14:21













@Draco18s You said Its settings aren't sufficient but what exactly is missing? Any idea what I could try to fix it then (apart from getting rid of the layout group, which I can't do because I need the buttons to be sorted)?

– Neph
Nov 19 '18 at 11:45





@Draco18s You said Its settings aren't sufficient but what exactly is missing? Any idea what I could try to fix it then (apart from getting rid of the layout group, which I can't do because I need the buttons to be sorted)?

– Neph
Nov 19 '18 at 11:45













When I said that you didn't have a screen shot of its inspector, showing all of its settings. Now you do (or at least, converted it from a link that I hadn't seen), so that comment is no longer relevant.

– Draco18s
Nov 19 '18 at 15:26






When I said that you didn't have a screen shot of its inspector, showing all of its settings. Now you do (or at least, converted it from a link that I hadn't seen), so that comment is no longer relevant.

– Draco18s
Nov 19 '18 at 15:26













0






active

oldest

votes











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%2f53285226%2funity-button-spacing-differs-at-different-screen-resolutions%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















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%2f53285226%2funity-button-spacing-differs-at-different-screen-resolutions%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







這個網誌中的熱門文章

What does pagestruct do in Eviews?

Dutch intervention in Lombok and Karangasem

Channel Islands