How to use a circle shape in android

간단한 예제를 통해 Shape를 설명합니다.

먼저 생성되는 shape xml파일의 위치는 res/drawable에 위치하도록 합니다.

원형의 배경이 꽉찬 shape xml파일을 생성합니다. 생성한 xml을 TextView의 background로 적용해보겠습니다.

circle_background_fill.xml
activity_learn_circle.xml
run screen

위와같이 결과 화면일 볼수있습니다.

다음은 속은 비어있고 테두리만 지정된 원형입니다.

circle_background_empty.xml
activity_learn_circle.xml
run screen

이번엔 테두리와 background를 모두 사용합니다.

circle_both.xml
activity_learn_circle.xml
run screen

shape는 재사용성이 높아 자주 사용되는 형태의 xml을 작성하여 사용하면 됩니다.

GitHub – https://github.com/springcome/LearnAndroid

19 Comments

  1. If you wish for to improve your experience simply keep visiting this site
    and be updated with the newest gossip posted here.

  2. I’m more than happy to discover this great site.

    I need to to thank you for ones time for this particularly wonderful read!!
    I definitely liked every little bit of it and I have you bookmarked
    to see new things in your site.

  3. Good day! I could have sworn I’ve been to this website before but after reading through some of the post I realized it’s new to me.

    Nonetheless, I’m definitely glad I found it and I’ll be book-marking and checking back frequently!

  4. This site was… how do you say it? Relevant!! Finally I’ve found
    something which helped me. Appreciate it!

  5. Thanks for one’s marvelous posting! I definitely enjoyed reading it, you happen to be a great author.I will remember to bookmark your blog
    and will eventually come back very soon. I want to encourage you continue your great work, have
    a nice day!

  6. It’s in reality a great and helpful piece of information. I’m glad that you shared this useful info with
    us. Please keep us informed like this. Thank you for sharing.

  7. Wow that was strange. I just wrote an extremely long comment
    but after I clicked submit my comment didn’t appear.
    Grrrr… well I’m not writing all that over again. Anyway, just wanted to
    say fantastic blog!

  8. I do not know whether it’s just me or if everybody else experiencing issues with your website.

    It appears like some of the written text on your content are running off the screen. Can someone else please provide feedback and let me know if this is happening to
    them too? This might be a problem with my internet browser because I’ve had
    this happen before. Many thanks

  9. This information is invaluable. When can I find out
    more?

  10. My partner and I stumbled over here from a different page and thought
    I might check things out. I like what I see so now i’m following you.
    Look forward to checking out your web page yet again.

  11. Hey there! This is kind of off topic but I need some guidance
    from an established blog. Is it very hard to set up your own blog?
    I’m not very techincal but I can figure things out pretty quick.
    I’m thinking about setting up my own but I’m not sure
    where to start. Do you have any points or suggestions?
    Many thanks

  12. I couldn’t refrain from commenting. Well written!

  13. Marvelous, what a webpage it is! This web site presents valuable information to us, keep it
    up.

  14. Please let me know if you’re looking for a article writer for your weblog.
    You have some really good articles and I believe I
    would be a good asset. If you ever want to take some of the load
    off, I’d love to write some material for your blog in exchange
    for a link back to mine. Please blast me an e-mail if interested.

    Thank you!

  15. Thank you, I’ve recently been looking for information about this topic for ages
    and yours is the best I’ve discovered till now. But, what concerning the bottom line?
    Are you positive about the supply?

  16. I know this if off topic but I’m looking into starting my own weblog and was curious what
    all is needed to get setup? I’m assuming having a blog like yours would cost a pretty penny?
    I’m not very web smart so I’m not 100% positive.
    Any tips or advice would be greatly appreciated. Thank
    you

  17. I think the admin of this site is in fact
    working hard for his website, since here every
    stuff is quality based data.

  18. Hi, I desire to subscribe for this web site to take latest updates, so
    where can i do it please help.

  19. Amazing things here. I am very glad to see your post.
    Thank you a lot and I’m taking a look forward to contact you.
    Will you please drop me a mail?

댓글 남기기

이메일은 공개되지 않습니다.