{"id":9491,"date":"2024-03-14T09:42:52","date_gmt":"2024-03-14T09:42:52","guid":{"rendered":"https:\/\/www.silicloud.com\/blog\/what-is-the-method-for-setting-the-shadow-border-on-android\/"},"modified":"2024-03-20T15:37:52","modified_gmt":"2024-03-20T15:37:52","slug":"what-is-the-method-for-setting-the-shadow-border-on-android","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/blog\/what-is-the-method-for-setting-the-shadow-border-on-android\/","title":{"rendered":"What is the method for setting the shadow border on Android?"},"content":{"rendered":"<p>In Android, you can use the elevation attribute to create a shadow effect. The elevation attribute is a property in the View class used to set the Z-axis height of a View and produce a shadow effect. For example:<\/p>\n<pre class=\"post-pre\"><code><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">View<\/span>\r\n    <span class=\"hljs-attr\">android:layout_width<\/span>=<span class=\"hljs-string\">\"match_parent\"<\/span>\r\n    <span class=\"hljs-attr\">android:layout_height<\/span>=<span class=\"hljs-string\">\"wrap_content\"<\/span>\r\n    <span class=\"hljs-attr\">android:elevation<\/span>=<span class=\"hljs-string\">\"8dp\"<\/span>\r\n    <span class=\"hljs-attr\">android:background<\/span>=<span class=\"hljs-string\">\"@android:color\/white\"<\/span>\/&gt;<\/span>\r\n<\/code><\/pre>\n<p>In the example above, the elevation property is set to 8dp, indicating the View&#8217;s Z-axis height is 8dp, creating a shadow effect. The depth of the shadow can be adjusted by changing the value of the elevation as needed.<\/p>\n<p>Additionally, if you want to set the border of a View, you can use the Stroke and StrokeColor properties to achieve this. For example:<\/p>\n<pre class=\"post-pre\"><code><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">View<\/span>\r\n    <span class=\"hljs-attr\">android:layout_width<\/span>=<span class=\"hljs-string\">\"match_parent\"<\/span>\r\n    <span class=\"hljs-attr\">android:layout_height<\/span>=<span class=\"hljs-string\">\"wrap_content\"<\/span>\r\n    <span class=\"hljs-attr\">android:background<\/span>=<span class=\"hljs-string\">\"@android:color\/white\"<\/span>\r\n    <span class=\"hljs-attr\">android:strokeWidth<\/span>=<span class=\"hljs-string\">\"2dp\"<\/span>\r\n    <span class=\"hljs-attr\">android:strokeColor<\/span>=<span class=\"hljs-string\">\"@android:color\/black\"<\/span>\/&gt;<\/span>\r\n<\/code><\/pre>\n<p>In the above example, the strokeWidth property is set to 2dp, indicating that the border width is 2dp, and the strokeColor property is set to @android:color\/black, indicating that the border color is black. The border style can be adjusted by changing the values of strokeWidth and strokeColor as needed.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In Android, you can use the elevation attribute to create a shadow effect. The elevation attribute is a property in the View class used to set the Z-axis height of a View and produce a shadow effect. For example: &lt;View android:layout_width=&#8221;match_parent&#8221; android:layout_height=&#8221;wrap_content&#8221; android:elevation=&#8221;8dp&#8221; android:background=&#8221;@android:color\/white&#8221;\/&gt; In the example above, the elevation property is set to 8dp, [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-9491","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>What is the method for setting the shadow border on Android? - Blog - Silicon Cloud<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/blog\/what-is-the-method-for-setting-the-shadow-border-on-android\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What is the method for setting the shadow border on Android?\" \/>\n<meta property=\"og:description\" content=\"In Android, you can use the elevation attribute to create a shadow effect. The elevation attribute is a property in the View class used to set the Z-axis height of a View and produce a shadow effect. For example: &lt;View android:layout_width=&quot;match_parent&quot; android:layout_height=&quot;wrap_content&quot; android:elevation=&quot;8dp&quot; android:background=&quot;@android:color\/white&quot;\/&gt; In the example above, the elevation property is set to 8dp, [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/blog\/what-is-the-method-for-setting-the-shadow-border-on-android\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/SiliCloudGlobal\/\" \/>\n<meta property=\"article:published_time\" content=\"2024-03-14T09:42:52+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-20T15:37:52+00:00\" \/>\n<meta name=\"author\" content=\"Benjamin Taylor\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@SiliCloudGlobal\" \/>\n<meta name=\"twitter:site\" content=\"@SiliCloudGlobal\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Benjamin Taylor\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/what-is-the-method-for-setting-the-shadow-border-on-android\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/what-is-the-method-for-setting-the-shadow-border-on-android\/\"},\"author\":{\"name\":\"Benjamin Taylor\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/ac801fe9549a25960ce48aa2e0a691c9\"},\"headline\":\"What is the method for setting the shadow border on Android?\",\"datePublished\":\"2024-03-14T09:42:52+00:00\",\"dateModified\":\"2024-03-20T15:37:52+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/what-is-the-method-for-setting-the-shadow-border-on-android\/\"},\"wordCount\":165,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/#organization\"},\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/what-is-the-method-for-setting-the-shadow-border-on-android\/\",\"url\":\"https:\/\/www.silicloud.com\/blog\/what-is-the-method-for-setting-the-shadow-border-on-android\/\",\"name\":\"What is the method for setting the shadow border on Android? - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/#website\"},\"datePublished\":\"2024-03-14T09:42:52+00:00\",\"dateModified\":\"2024-03-20T15:37:52+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/what-is-the-method-for-setting-the-shadow-border-on-android\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/blog\/what-is-the-method-for-setting-the-shadow-border-on-android\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/what-is-the-method-for-setting-the-shadow-border-on-android\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.silicloud.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"What is the method for setting the shadow border on Android?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/blog\/\",\"name\":\"Silicon Cloud Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/#organization\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#organization\",\"name\":\"Silicon Cloud Blog\",\"url\":\"https:\/\/www.silicloud.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.silicloud.com\/blog\/wp-content\/uploads\/2023\/11\/EN-SILICON-Full.png\",\"contentUrl\":\"https:\/\/www.silicloud.com\/blog\/wp-content\/uploads\/2023\/11\/EN-SILICON-Full.png\",\"width\":1024,\"height\":1024,\"caption\":\"Silicon Cloud Blog\"},\"image\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/SiliCloudGlobal\/\",\"https:\/\/twitter.com\/SiliCloudGlobal\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/ac801fe9549a25960ce48aa2e0a691c9\",\"name\":\"Benjamin Taylor\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ec2e3d3e2d525fd148047c4520ae7c1cdccd1f4b48a1a488422b31f04f345c14?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/ec2e3d3e2d525fd148047c4520ae7c1cdccd1f4b48a1a488422b31f04f345c14?s=96&d=mm&r=g\",\"caption\":\"Benjamin Taylor\"},\"url\":\"https:\/\/www.silicloud.com\/blog\/author\/benjamintaylor\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"What is the method for setting the shadow border on Android? - Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/blog\/what-is-the-method-for-setting-the-shadow-border-on-android\/","og_locale":"en_US","og_type":"article","og_title":"What is the method for setting the shadow border on Android?","og_description":"In Android, you can use the elevation attribute to create a shadow effect. The elevation attribute is a property in the View class used to set the Z-axis height of a View and produce a shadow effect. For example: &lt;View android:layout_width=\"match_parent\" android:layout_height=\"wrap_content\" android:elevation=\"8dp\" android:background=\"@android:color\/white\"\/&gt; In the example above, the elevation property is set to 8dp, [&hellip;]","og_url":"https:\/\/www.silicloud.com\/blog\/what-is-the-method-for-setting-the-shadow-border-on-android\/","og_site_name":"Blog - Silicon Cloud","article_publisher":"https:\/\/www.facebook.com\/SiliCloudGlobal\/","article_published_time":"2024-03-14T09:42:52+00:00","article_modified_time":"2024-03-20T15:37:52+00:00","author":"Benjamin Taylor","twitter_card":"summary_large_image","twitter_creator":"@SiliCloudGlobal","twitter_site":"@SiliCloudGlobal","twitter_misc":{"Written by":"Benjamin Taylor","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.silicloud.com\/blog\/what-is-the-method-for-setting-the-shadow-border-on-android\/#article","isPartOf":{"@id":"https:\/\/www.silicloud.com\/blog\/what-is-the-method-for-setting-the-shadow-border-on-android\/"},"author":{"name":"Benjamin Taylor","@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/ac801fe9549a25960ce48aa2e0a691c9"},"headline":"What is the method for setting the shadow border on Android?","datePublished":"2024-03-14T09:42:52+00:00","dateModified":"2024-03-20T15:37:52+00:00","mainEntityOfPage":{"@id":"https:\/\/www.silicloud.com\/blog\/what-is-the-method-for-setting-the-shadow-border-on-android\/"},"wordCount":165,"commentCount":0,"publisher":{"@id":"https:\/\/www.silicloud.com\/blog\/#organization"},"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/blog\/what-is-the-method-for-setting-the-shadow-border-on-android\/","url":"https:\/\/www.silicloud.com\/blog\/what-is-the-method-for-setting-the-shadow-border-on-android\/","name":"What is the method for setting the shadow border on Android? - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/blog\/#website"},"datePublished":"2024-03-14T09:42:52+00:00","dateModified":"2024-03-20T15:37:52+00:00","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/blog\/what-is-the-method-for-setting-the-shadow-border-on-android\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/blog\/what-is-the-method-for-setting-the-shadow-border-on-android\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/blog\/what-is-the-method-for-setting-the-shadow-border-on-android\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.silicloud.com\/blog\/"},{"@type":"ListItem","position":2,"name":"What is the method for setting the shadow border on Android?"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/blog\/#website","url":"https:\/\/www.silicloud.com\/blog\/","name":"Silicon Cloud Blog","description":"","publisher":{"@id":"https:\/\/www.silicloud.com\/blog\/#organization"},"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.silicloud.com\/blog\/#organization","name":"Silicon Cloud Blog","url":"https:\/\/www.silicloud.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.silicloud.com\/blog\/wp-content\/uploads\/2023\/11\/EN-SILICON-Full.png","contentUrl":"https:\/\/www.silicloud.com\/blog\/wp-content\/uploads\/2023\/11\/EN-SILICON-Full.png","width":1024,"height":1024,"caption":"Silicon Cloud Blog"},"image":{"@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/SiliCloudGlobal\/","https:\/\/twitter.com\/SiliCloudGlobal"]},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/ac801fe9549a25960ce48aa2e0a691c9","name":"Benjamin Taylor","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/ec2e3d3e2d525fd148047c4520ae7c1cdccd1f4b48a1a488422b31f04f345c14?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ec2e3d3e2d525fd148047c4520ae7c1cdccd1f4b48a1a488422b31f04f345c14?s=96&d=mm&r=g","caption":"Benjamin Taylor"},"url":"https:\/\/www.silicloud.com\/blog\/author\/benjamintaylor\/"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/posts\/9491","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/comments?post=9491"}],"version-history":[{"count":1,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/posts\/9491\/revisions"}],"predecessor-version":[{"id":42671,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/posts\/9491\/revisions\/42671"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/media?parent=9491"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/categories?post=9491"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/tags?post=9491"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}