How to Achieve Self-Resizing Height for UITableViewCell and a UIStackView?












0














I have a UITableViewCell, with a UIView bottom container since I'm new around here I'll leave this link so you can get the idea:



Basic Static Cell



The bottom container does also use a Stack View at its right side to hold those "Options" as shown in the Image, I need to make the cell all dynamic since sometimes I can have 2 options, to 15 options and well it wouldn't look good setting it up with 15 options and only show 2 options, I'm having quite a rough time trying to think how to achieve this behavior here's another image to clarify what I'm trying to do:



Behavior Example



I'm just looking for tips/recommendations on how would I achieve this behavior any source of info, anything, and thanks so much in advance and if I wasn't clear enough please let me know I tried my best with the images trying to explain what I want to do but if it wasn't enough do let me know! Couldn't find an specific answer to this kind of behavior so yeah my bad if this was already asked.



EDIT: The options within the right side of the bottom container that are inside the UIStackView are little UIViews with just a label and a button, my bad.










share|improve this question
























  • Maybe this will help? stackoverflow.com/questions/34348555/… This is something I wish Apple would implement into the language in an easier fashion.
    – Dom
    Nov 21 '18 at 20:54












  • Thanks for the info and your time reading the thread @Dom however I see that's for TextViews, I forgot to mention what's actually inside the stack view that holds the options, they are just little UIViews added with a label and a button! if there's a detail that I left out I'm sorry!
    – nepta.din
    Nov 21 '18 at 21:35
















0














I have a UITableViewCell, with a UIView bottom container since I'm new around here I'll leave this link so you can get the idea:



Basic Static Cell



The bottom container does also use a Stack View at its right side to hold those "Options" as shown in the Image, I need to make the cell all dynamic since sometimes I can have 2 options, to 15 options and well it wouldn't look good setting it up with 15 options and only show 2 options, I'm having quite a rough time trying to think how to achieve this behavior here's another image to clarify what I'm trying to do:



Behavior Example



I'm just looking for tips/recommendations on how would I achieve this behavior any source of info, anything, and thanks so much in advance and if I wasn't clear enough please let me know I tried my best with the images trying to explain what I want to do but if it wasn't enough do let me know! Couldn't find an specific answer to this kind of behavior so yeah my bad if this was already asked.



EDIT: The options within the right side of the bottom container that are inside the UIStackView are little UIViews with just a label and a button, my bad.










share|improve this question
























  • Maybe this will help? stackoverflow.com/questions/34348555/… This is something I wish Apple would implement into the language in an easier fashion.
    – Dom
    Nov 21 '18 at 20:54












  • Thanks for the info and your time reading the thread @Dom however I see that's for TextViews, I forgot to mention what's actually inside the stack view that holds the options, they are just little UIViews added with a label and a button! if there's a detail that I left out I'm sorry!
    – nepta.din
    Nov 21 '18 at 21:35














0












0








0







I have a UITableViewCell, with a UIView bottom container since I'm new around here I'll leave this link so you can get the idea:



Basic Static Cell



The bottom container does also use a Stack View at its right side to hold those "Options" as shown in the Image, I need to make the cell all dynamic since sometimes I can have 2 options, to 15 options and well it wouldn't look good setting it up with 15 options and only show 2 options, I'm having quite a rough time trying to think how to achieve this behavior here's another image to clarify what I'm trying to do:



Behavior Example



I'm just looking for tips/recommendations on how would I achieve this behavior any source of info, anything, and thanks so much in advance and if I wasn't clear enough please let me know I tried my best with the images trying to explain what I want to do but if it wasn't enough do let me know! Couldn't find an specific answer to this kind of behavior so yeah my bad if this was already asked.



EDIT: The options within the right side of the bottom container that are inside the UIStackView are little UIViews with just a label and a button, my bad.










share|improve this question















I have a UITableViewCell, with a UIView bottom container since I'm new around here I'll leave this link so you can get the idea:



Basic Static Cell



The bottom container does also use a Stack View at its right side to hold those "Options" as shown in the Image, I need to make the cell all dynamic since sometimes I can have 2 options, to 15 options and well it wouldn't look good setting it up with 15 options and only show 2 options, I'm having quite a rough time trying to think how to achieve this behavior here's another image to clarify what I'm trying to do:



Behavior Example



I'm just looking for tips/recommendations on how would I achieve this behavior any source of info, anything, and thanks so much in advance and if I wasn't clear enough please let me know I tried my best with the images trying to explain what I want to do but if it wasn't enough do let me know! Couldn't find an specific answer to this kind of behavior so yeah my bad if this was already asked.



EDIT: The options within the right side of the bottom container that are inside the UIStackView are little UIViews with just a label and a button, my bad.







ios iphone uitableview ios-autolayout uistackview






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 21 '18 at 21:16







nepta.din

















asked Nov 21 '18 at 20:50









nepta.dinnepta.din

12




12












  • Maybe this will help? stackoverflow.com/questions/34348555/… This is something I wish Apple would implement into the language in an easier fashion.
    – Dom
    Nov 21 '18 at 20:54












  • Thanks for the info and your time reading the thread @Dom however I see that's for TextViews, I forgot to mention what's actually inside the stack view that holds the options, they are just little UIViews added with a label and a button! if there's a detail that I left out I'm sorry!
    – nepta.din
    Nov 21 '18 at 21:35


















  • Maybe this will help? stackoverflow.com/questions/34348555/… This is something I wish Apple would implement into the language in an easier fashion.
    – Dom
    Nov 21 '18 at 20:54












  • Thanks for the info and your time reading the thread @Dom however I see that's for TextViews, I forgot to mention what's actually inside the stack view that holds the options, they are just little UIViews added with a label and a button! if there's a detail that I left out I'm sorry!
    – nepta.din
    Nov 21 '18 at 21:35
















Maybe this will help? stackoverflow.com/questions/34348555/… This is something I wish Apple would implement into the language in an easier fashion.
– Dom
Nov 21 '18 at 20:54






Maybe this will help? stackoverflow.com/questions/34348555/… This is something I wish Apple would implement into the language in an easier fashion.
– Dom
Nov 21 '18 at 20:54














Thanks for the info and your time reading the thread @Dom however I see that's for TextViews, I forgot to mention what's actually inside the stack view that holds the options, they are just little UIViews added with a label and a button! if there's a detail that I left out I'm sorry!
– nepta.din
Nov 21 '18 at 21:35




Thanks for the info and your time reading the thread @Dom however I see that's for TextViews, I forgot to mention what's actually inside the stack view that holds the options, they are just little UIViews added with a label and a button! if there's a detail that I left out I'm sorry!
– nepta.din
Nov 21 '18 at 21:35












1 Answer
1






active

oldest

votes


















0














My friend came up with a nice idea, what he ended up doing was to assign different heights based on how many options we would receive so there was no need to edit the constraints in auto-layout or something like that, since the options were dynamically added to the stack view as shown in the images and the maximum of options that we would get was 15, he based different sizes such as small, medium, large, with different values depending on how many options we would get!






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%2f53420277%2fhow-to-achieve-self-resizing-height-for-uitableviewcell-and-a-uistackview%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














    My friend came up with a nice idea, what he ended up doing was to assign different heights based on how many options we would receive so there was no need to edit the constraints in auto-layout or something like that, since the options were dynamically added to the stack view as shown in the images and the maximum of options that we would get was 15, he based different sizes such as small, medium, large, with different values depending on how many options we would get!






    share|improve this answer


























      0














      My friend came up with a nice idea, what he ended up doing was to assign different heights based on how many options we would receive so there was no need to edit the constraints in auto-layout or something like that, since the options were dynamically added to the stack view as shown in the images and the maximum of options that we would get was 15, he based different sizes such as small, medium, large, with different values depending on how many options we would get!






      share|improve this answer
























        0












        0








        0






        My friend came up with a nice idea, what he ended up doing was to assign different heights based on how many options we would receive so there was no need to edit the constraints in auto-layout or something like that, since the options were dynamically added to the stack view as shown in the images and the maximum of options that we would get was 15, he based different sizes such as small, medium, large, with different values depending on how many options we would get!






        share|improve this answer












        My friend came up with a nice idea, what he ended up doing was to assign different heights based on how many options we would receive so there was no need to edit the constraints in auto-layout or something like that, since the options were dynamically added to the stack view as shown in the images and the maximum of options that we would get was 15, he based different sizes such as small, medium, large, with different values depending on how many options we would get!







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 22 '18 at 5:45









        nepta.dinnepta.din

        12




        12






























            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.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • 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%2f53420277%2fhow-to-achieve-self-resizing-height-for-uitableviewcell-and-a-uistackview%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

            404 Error Contact Form 7 ajax form submitting

            How to know if a Active Directory user can login interactively

            Refactoring coordinates for Minecraft Pi buildings written in Python