Not all items in layer-list are showing up












0














I'm trying to implement a view like what's in this link here: https://imgur.com/a/6b75AMp



This is the layer-list I'm using:



<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">


<item>
<shape android:shape="rectangle">
<corners android:radius="10dp" />
<solid android:color="@color/HobbesLightGreen"/>
</shape>
</item>

<item android:left="8dp">
<shape android:shape="rectangle">
<corners android:radius="10dp" />
<solid android:color="@color/HobbesBackground"/>
</shape>
</item>

<item>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">

// The width and color of the border
<stroke
android:width="1dp"
android:color="#3C341F" />

// The desired corner radius. reduce it to keep it less rounded
<corners android:radius="10dp" />
<solid
android:color="#F0ECE0"
/>


</shape>
</item>


</layer-list>


However, the border doesn't show up. If I play around with the order of the items--for example, if I make the vertical stripe the last item--then the border might show up, but the vertical stripe won't. How do I get everything in the layer-list to show up properly?










share|improve this question



























    0














    I'm trying to implement a view like what's in this link here: https://imgur.com/a/6b75AMp



    This is the layer-list I'm using:



    <?xml version="1.0" encoding="utf-8"?>
    <layer-list xmlns:android="http://schemas.android.com/apk/res/android">


    <item>
    <shape android:shape="rectangle">
    <corners android:radius="10dp" />
    <solid android:color="@color/HobbesLightGreen"/>
    </shape>
    </item>

    <item android:left="8dp">
    <shape android:shape="rectangle">
    <corners android:radius="10dp" />
    <solid android:color="@color/HobbesBackground"/>
    </shape>
    </item>

    <item>
    <shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">

    // The width and color of the border
    <stroke
    android:width="1dp"
    android:color="#3C341F" />

    // The desired corner radius. reduce it to keep it less rounded
    <corners android:radius="10dp" />
    <solid
    android:color="#F0ECE0"
    />


    </shape>
    </item>


    </layer-list>


    However, the border doesn't show up. If I play around with the order of the items--for example, if I make the vertical stripe the last item--then the border might show up, but the vertical stripe won't. How do I get everything in the layer-list to show up properly?










    share|improve this question

























      0












      0








      0







      I'm trying to implement a view like what's in this link here: https://imgur.com/a/6b75AMp



      This is the layer-list I'm using:



      <?xml version="1.0" encoding="utf-8"?>
      <layer-list xmlns:android="http://schemas.android.com/apk/res/android">


      <item>
      <shape android:shape="rectangle">
      <corners android:radius="10dp" />
      <solid android:color="@color/HobbesLightGreen"/>
      </shape>
      </item>

      <item android:left="8dp">
      <shape android:shape="rectangle">
      <corners android:radius="10dp" />
      <solid android:color="@color/HobbesBackground"/>
      </shape>
      </item>

      <item>
      <shape xmlns:android="http://schemas.android.com/apk/res/android"
      android:shape="rectangle">

      // The width and color of the border
      <stroke
      android:width="1dp"
      android:color="#3C341F" />

      // The desired corner radius. reduce it to keep it less rounded
      <corners android:radius="10dp" />
      <solid
      android:color="#F0ECE0"
      />


      </shape>
      </item>


      </layer-list>


      However, the border doesn't show up. If I play around with the order of the items--for example, if I make the vertical stripe the last item--then the border might show up, but the vertical stripe won't. How do I get everything in the layer-list to show up properly?










      share|improve this question













      I'm trying to implement a view like what's in this link here: https://imgur.com/a/6b75AMp



      This is the layer-list I'm using:



      <?xml version="1.0" encoding="utf-8"?>
      <layer-list xmlns:android="http://schemas.android.com/apk/res/android">


      <item>
      <shape android:shape="rectangle">
      <corners android:radius="10dp" />
      <solid android:color="@color/HobbesLightGreen"/>
      </shape>
      </item>

      <item android:left="8dp">
      <shape android:shape="rectangle">
      <corners android:radius="10dp" />
      <solid android:color="@color/HobbesBackground"/>
      </shape>
      </item>

      <item>
      <shape xmlns:android="http://schemas.android.com/apk/res/android"
      android:shape="rectangle">

      // The width and color of the border
      <stroke
      android:width="1dp"
      android:color="#3C341F" />

      // The desired corner radius. reduce it to keep it less rounded
      <corners android:radius="10dp" />
      <solid
      android:color="#F0ECE0"
      />


      </shape>
      </item>


      </layer-list>


      However, the border doesn't show up. If I play around with the order of the items--for example, if I make the vertical stripe the last item--then the border might show up, but the vertical stripe won't. How do I get everything in the layer-list to show up properly?







      android






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 23 '18 at 7:25









      twistedmister

      115




      115
























          2 Answers
          2






          active

          oldest

          votes


















          0














          try the following code you will get a hint



          <?xml version="1.0" encoding="utf-8"?>




          <item>
          <shape android:shape="rectangle">
          <corners android:radius="10dp" />
          <solid android:color="@color/HobbesLightGreen" />
          </shape>
          </item>

          <item android:left="4dp" android:top="4dp" android:right="4dp" android:bottom="4dp">
          <shape android:shape="rectangle">
          <corners android:radius="10dp" />
          <solid android:color="@color/HobbesBackground" />
          </shape>
          </item>

          <item android:left="8dp" android:top="8dp" android:right="8dp" android:bottom="8dp">
          <shape xmlns:android="http://schemas.android.com/apk/res/android"
          android:shape="rectangle">

          <stroke android:width="1dp" android:color="#3C341F" />
          <corners android:radius="10dp" />
          <solid android:color="#F0ECE0" />

          </shape>
          </item>







          share|improve this answer





















          • This was the perfect amount of help, thank you.
            – twistedmister
            Nov 23 '18 at 7:58










          • @twistedmister did it work ?
            – Har Kal
            Nov 23 '18 at 10:36










          • I think I accepted it? The checkmark next to your answer is now green.
            – twistedmister
            Nov 24 '18 at 2:56





















          0














          I have modified some of your code, use it and chech the output.






          <item>
          <shape android:shape="rectangle">
          <corners android:radius="10dp" />
          <solid android:color="@color/colorPrimary"/>
          </shape>
          </item>

          <item android:left="8dp">
          <shape android:shape="rectangle">
          <corners android:radius="10dp" />
          <solid android:color="@color/colorAccent"/>
          </shape>
          </item>

          <item>
          <shape android:shape="rectangle">
          <corners android:radius="10dp" />
          <stroke android:color="#000000" android:width="2dp"/>
          </shape>
          </item>







          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%2f53442286%2fnot-all-items-in-layer-list-are-showing-up%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            try the following code you will get a hint



            <?xml version="1.0" encoding="utf-8"?>




            <item>
            <shape android:shape="rectangle">
            <corners android:radius="10dp" />
            <solid android:color="@color/HobbesLightGreen" />
            </shape>
            </item>

            <item android:left="4dp" android:top="4dp" android:right="4dp" android:bottom="4dp">
            <shape android:shape="rectangle">
            <corners android:radius="10dp" />
            <solid android:color="@color/HobbesBackground" />
            </shape>
            </item>

            <item android:left="8dp" android:top="8dp" android:right="8dp" android:bottom="8dp">
            <shape xmlns:android="http://schemas.android.com/apk/res/android"
            android:shape="rectangle">

            <stroke android:width="1dp" android:color="#3C341F" />
            <corners android:radius="10dp" />
            <solid android:color="#F0ECE0" />

            </shape>
            </item>







            share|improve this answer





















            • This was the perfect amount of help, thank you.
              – twistedmister
              Nov 23 '18 at 7:58










            • @twistedmister did it work ?
              – Har Kal
              Nov 23 '18 at 10:36










            • I think I accepted it? The checkmark next to your answer is now green.
              – twistedmister
              Nov 24 '18 at 2:56


















            0














            try the following code you will get a hint



            <?xml version="1.0" encoding="utf-8"?>




            <item>
            <shape android:shape="rectangle">
            <corners android:radius="10dp" />
            <solid android:color="@color/HobbesLightGreen" />
            </shape>
            </item>

            <item android:left="4dp" android:top="4dp" android:right="4dp" android:bottom="4dp">
            <shape android:shape="rectangle">
            <corners android:radius="10dp" />
            <solid android:color="@color/HobbesBackground" />
            </shape>
            </item>

            <item android:left="8dp" android:top="8dp" android:right="8dp" android:bottom="8dp">
            <shape xmlns:android="http://schemas.android.com/apk/res/android"
            android:shape="rectangle">

            <stroke android:width="1dp" android:color="#3C341F" />
            <corners android:radius="10dp" />
            <solid android:color="#F0ECE0" />

            </shape>
            </item>







            share|improve this answer





















            • This was the perfect amount of help, thank you.
              – twistedmister
              Nov 23 '18 at 7:58










            • @twistedmister did it work ?
              – Har Kal
              Nov 23 '18 at 10:36










            • I think I accepted it? The checkmark next to your answer is now green.
              – twistedmister
              Nov 24 '18 at 2:56
















            0












            0








            0






            try the following code you will get a hint



            <?xml version="1.0" encoding="utf-8"?>




            <item>
            <shape android:shape="rectangle">
            <corners android:radius="10dp" />
            <solid android:color="@color/HobbesLightGreen" />
            </shape>
            </item>

            <item android:left="4dp" android:top="4dp" android:right="4dp" android:bottom="4dp">
            <shape android:shape="rectangle">
            <corners android:radius="10dp" />
            <solid android:color="@color/HobbesBackground" />
            </shape>
            </item>

            <item android:left="8dp" android:top="8dp" android:right="8dp" android:bottom="8dp">
            <shape xmlns:android="http://schemas.android.com/apk/res/android"
            android:shape="rectangle">

            <stroke android:width="1dp" android:color="#3C341F" />
            <corners android:radius="10dp" />
            <solid android:color="#F0ECE0" />

            </shape>
            </item>







            share|improve this answer












            try the following code you will get a hint



            <?xml version="1.0" encoding="utf-8"?>




            <item>
            <shape android:shape="rectangle">
            <corners android:radius="10dp" />
            <solid android:color="@color/HobbesLightGreen" />
            </shape>
            </item>

            <item android:left="4dp" android:top="4dp" android:right="4dp" android:bottom="4dp">
            <shape android:shape="rectangle">
            <corners android:radius="10dp" />
            <solid android:color="@color/HobbesBackground" />
            </shape>
            </item>

            <item android:left="8dp" android:top="8dp" android:right="8dp" android:bottom="8dp">
            <shape xmlns:android="http://schemas.android.com/apk/res/android"
            android:shape="rectangle">

            <stroke android:width="1dp" android:color="#3C341F" />
            <corners android:radius="10dp" />
            <solid android:color="#F0ECE0" />

            </shape>
            </item>








            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 23 '18 at 7:31









            Har Kal

            599314




            599314












            • This was the perfect amount of help, thank you.
              – twistedmister
              Nov 23 '18 at 7:58










            • @twistedmister did it work ?
              – Har Kal
              Nov 23 '18 at 10:36










            • I think I accepted it? The checkmark next to your answer is now green.
              – twistedmister
              Nov 24 '18 at 2:56




















            • This was the perfect amount of help, thank you.
              – twistedmister
              Nov 23 '18 at 7:58










            • @twistedmister did it work ?
              – Har Kal
              Nov 23 '18 at 10:36










            • I think I accepted it? The checkmark next to your answer is now green.
              – twistedmister
              Nov 24 '18 at 2:56


















            This was the perfect amount of help, thank you.
            – twistedmister
            Nov 23 '18 at 7:58




            This was the perfect amount of help, thank you.
            – twistedmister
            Nov 23 '18 at 7:58












            @twistedmister did it work ?
            – Har Kal
            Nov 23 '18 at 10:36




            @twistedmister did it work ?
            – Har Kal
            Nov 23 '18 at 10:36












            I think I accepted it? The checkmark next to your answer is now green.
            – twistedmister
            Nov 24 '18 at 2:56






            I think I accepted it? The checkmark next to your answer is now green.
            – twistedmister
            Nov 24 '18 at 2:56















            0














            I have modified some of your code, use it and chech the output.






            <item>
            <shape android:shape="rectangle">
            <corners android:radius="10dp" />
            <solid android:color="@color/colorPrimary"/>
            </shape>
            </item>

            <item android:left="8dp">
            <shape android:shape="rectangle">
            <corners android:radius="10dp" />
            <solid android:color="@color/colorAccent"/>
            </shape>
            </item>

            <item>
            <shape android:shape="rectangle">
            <corners android:radius="10dp" />
            <stroke android:color="#000000" android:width="2dp"/>
            </shape>
            </item>







            share|improve this answer


























              0














              I have modified some of your code, use it and chech the output.






              <item>
              <shape android:shape="rectangle">
              <corners android:radius="10dp" />
              <solid android:color="@color/colorPrimary"/>
              </shape>
              </item>

              <item android:left="8dp">
              <shape android:shape="rectangle">
              <corners android:radius="10dp" />
              <solid android:color="@color/colorAccent"/>
              </shape>
              </item>

              <item>
              <shape android:shape="rectangle">
              <corners android:radius="10dp" />
              <stroke android:color="#000000" android:width="2dp"/>
              </shape>
              </item>







              share|improve this answer
























                0












                0








                0






                I have modified some of your code, use it and chech the output.






                <item>
                <shape android:shape="rectangle">
                <corners android:radius="10dp" />
                <solid android:color="@color/colorPrimary"/>
                </shape>
                </item>

                <item android:left="8dp">
                <shape android:shape="rectangle">
                <corners android:radius="10dp" />
                <solid android:color="@color/colorAccent"/>
                </shape>
                </item>

                <item>
                <shape android:shape="rectangle">
                <corners android:radius="10dp" />
                <stroke android:color="#000000" android:width="2dp"/>
                </shape>
                </item>







                share|improve this answer












                I have modified some of your code, use it and chech the output.






                <item>
                <shape android:shape="rectangle">
                <corners android:radius="10dp" />
                <solid android:color="@color/colorPrimary"/>
                </shape>
                </item>

                <item android:left="8dp">
                <shape android:shape="rectangle">
                <corners android:radius="10dp" />
                <solid android:color="@color/colorAccent"/>
                </shape>
                </item>

                <item>
                <shape android:shape="rectangle">
                <corners android:radius="10dp" />
                <stroke android:color="#000000" android:width="2dp"/>
                </shape>
                </item>








                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 23 '18 at 7:43









                Karan Mer

                4,34832764




                4,34832764






























                    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%2f53442286%2fnot-all-items-in-layer-list-are-showing-up%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

                    What visual should I use to simply compare current year value vs last year in Power BI desktop

                    Alexandru Averescu

                    Trompette piccolo