{"id":3632,"date":"2020-11-11T21:11:21","date_gmt":"2020-11-12T03:11:21","guid":{"rendered":"http:\/\/www.incredigeek.com\/home\/?p=3632"},"modified":"2020-11-20T09:19:13","modified_gmt":"2020-11-20T15:19:13","slug":"android-button-remove-shadow-and-border-from-button-with-image-on-it","status":"publish","type":"post","link":"https:\/\/www.incredigeek.com\/home\/android-button-remove-shadow-and-border-from-button-with-image-on-it\/","title":{"rendered":"Android Button &#8211; Remove Shadow and Border from Button with Image on it"},"content":{"rendered":"\n<p>We can remove the border and shadows from a button by adding the following style code in your activity_main.xml file.  Or what ever your XML file is.<\/p>\n\n\n\n<div style=\"height: 250px; position:relative; margin-bottom: 50px;\" class=\"wp-block-simple-code-block-ace\"><pre class=\"wp-block-simple-code-block-ace\" style=\"position:absolute;top:0;right:0;bottom:0;left:0\" data-mode=\"php\" data-theme=\"monokai\" data-fontsize=\"14\" data-lines=\"Infinity\" data-showlines=\"true\" data-copy=\"false\">style=\"?android:attr\/borderlessButtonStyle\"<\/pre><\/div>\n\n\n\n<p>Code for button.  We are setting an image as the background.<\/p>\n\n\n\n<div style=\"height: 250px; position:relative; margin-bottom: 50px;\" class=\"wp-block-simple-code-block-ace\"><pre class=\"wp-block-simple-code-block-ace\" style=\"position:absolute;top:0;right:0;bottom:0;left:0\" data-mode=\"php\" data-theme=\"monokai\" data-fontsize=\"14\" data-lines=\"Infinity\" data-showlines=\"true\" data-copy=\"false\">  &lt;Button\n        android:id=\"@+id\/button\"\n        style=\"?android:attr\/borderlessButtonStyle\"\n        android:layout_width=\"48dp\"\n        android:layout_height=\"48dp\"\n        android:background=\"@drawable\/gear\"\n        android:onClick=\"launchSettings\"\n        android:textSize=\"12sp\"\/>\n<\/pre><\/div>\n\n\n\n<p>Comparison of buttons.  One on the left still has the shadow on it<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"557\" height=\"338\" src=\"https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2020\/11\/image-2.png\" alt=\"\" class=\"wp-image-3633\" srcset=\"https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2020\/11\/image-2.png 557w, https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2020\/11\/image-2-300x182.png 300w, https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2020\/11\/image-2-494x300.png 494w\" sizes=\"auto, (max-width: 557px) 100vw, 557px\" \/><figcaption>Difference between border and borderless buttons<\/figcaption><\/figure>\n\n\n\n<p>More info here<\/p>\n\n\n\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/28756035\/how-to-remove-button-shadow-android\">https:\/\/stackoverflow.com\/questions\/28756035\/how-to-remove-button-shadow-android<\/a><br><a href=\"https:\/\/stackoverflow.com\/questions\/27867284\/remove-shadow-effect-on-android-button\/30856094\">https:\/\/stackoverflow.com\/questions\/27867284\/remove-shadow-effect-on-android-button\/30856094<\/a><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>We can remove the border and shadows from a button by adding the following style code in your activity_main.xml file. Or what ever your XML file is. Code for button. We are setting an image as the background. Comparison of &hellip; <a href=\"https:\/\/www.incredigeek.com\/home\/android-button-remove-shadow-and-border-from-button-with-image-on-it\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[540,792],"tags":[541,1104,649,498,606,1105],"class_list":["post-3632","post","type-post","status-publish","format-standard","hentry","category-android","category-programming","tag-android","tag-android-studio","tag-button","tag-image","tag-programming","tag-shadow"],"_links":{"self":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/3632","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/comments?post=3632"}],"version-history":[{"count":3,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/3632\/revisions"}],"predecessor-version":[{"id":3670,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/3632\/revisions\/3670"}],"wp:attachment":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/media?parent=3632"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/categories?post=3632"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/tags?post=3632"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}