{"id":22879,"date":"2018-11-23T09:35:19","date_gmt":"2018-11-23T09:35:19","guid":{"rendered":"https:\/\/www.knowband.com\/blog\/?p=22879\/"},"modified":"2022-08-13T12:01:14","modified_gmt":"2018-11-23T10:51:16","slug":"put-elements-in-linear-fashion-and-at-bottom-of-the-screen-in-android","status":"publish","type":"post","link":"https:\/\/www.knowband.com\/blog\/tips\/put-elements-in-linear-fashion-and-at-bottom-of-the-screen-in-android\/","title":{"rendered":"Put Elements in Linear Fashion and at the Bottom of the Screen in Android"},"content":{"rendered":"<p style=\"text-align: justify;\">The best way to put any elements in a linear fashion in Android is to use LinearLayout. Specify the attribute &#8216;<strong>orientation<\/strong>&#8216; of the LinearLayout to &#8216;<strong>vertical<\/strong>&#8216;.<\/p>\n<p style=\"text-align: justify;\">Now any number of elements put inside the LinearLayout will be in vertical order.<\/p>\n<p style=\"text-align: justify;\">To align the elements at the bottom of the screen, use ConstraintLayout and add constraints to the LinearLayout to attach it with the bottom of the screen.<\/p>\n<p style=\"text-align: justify;\">Find the sample code below where there are two TextView(s) placed one below the other and the container LinearLayout is attached to the bottom of the screen.<\/p>\n<pre class=\"brush: actionscript3; gutter: true\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;\r\n&lt;android.support.constraint.ConstraintLayout xmlns:android=&quot;https:\/\/schemas.android.com\/apk\/res\/android&quot;\r\nxmlns:app=&quot;https:\/\/schemas.android.com\/apk\/res-auto&quot;\r\nxmlns:tools=&quot;https:\/\/schemas.android.com\/tools&quot;\r\nandroid:layout_width=&quot;match_parent&quot;\r\nandroid:layout_height=&quot;match_parent&quot;\r\ntools:context=&quot;.MainActivity&quot;&gt;\r\n\r\n&lt;LinearLayout\r\nandroid:layout_width=&quot;match_parent&quot;\r\nandroid:layout_height=&quot;wrap_content&quot;\r\nandroid:orientation=&quot;vertical&quot;\r\napp:layout_constraintBottom_toBottomOf=&quot;parent&quot;\r\napp:layout_constraintEnd_toEndOf=&quot;parent&quot;\r\napp:layout_constraintStart_toStartOf=&quot;parent&quot;&gt;\r\n\r\n&lt;TextView\r\nandroid:id=&quot;@+id\/element1&quot;\r\nandroid:layout_width=&quot;wrap_content&quot;\r\nandroid:layout_height=&quot;wrap_content&quot;\r\nandroid:text=&quot;This is element 1&quot; \/&gt;\r\n\r\n&lt;TextView\r\nandroid:id=&quot;@+id\/element2&quot;\r\nandroid:layout_width=&quot;match_parent&quot;\r\nandroid:layout_height=&quot;wrap_content&quot;\r\nandroid:text=&quot;This is element 2&quot; \/&gt;\r\n\r\n&lt;\/LinearLayout&gt;\r\n\r\n&lt;\/android.support.constraint.ConstraintLayout&gt;<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The best way to put any elements in a linear fashion in Android is to use LinearLayout. Specify the attribute &#8216;orientation&#8216; of the LinearLayout to &#8216;vertical&#8216;. Now any number of elements put inside the LinearLayout will be in vertical order. To align the elements at the bottom of the screen, use ConstraintLayout and add constraints [&hellip;]<\/p>\n","protected":false},"author":16,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_kbui_enabled":"","footnotes":""},"categories":[1111],"tags":[8067,8068,8069,8066],"class_list":["post-22879","post","type-post","status-publish","format-standard","hentry","category-tips","tag-android-layout","tag-linear-fashion-in-android","tag-linearlayout","tag-put-element-in-linear-fashion"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Put Elements in Linear Fashion and at the Bottom of the Screen in Android - Knowband Blog | Ecommerce Modules<\/title>\n<meta name=\"description\" content=\"The best way to put any elements in a linear fashion in Android is to use LinearLayout\" \/>\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.knowband.com\/blog\/tips\/put-elements-in-linear-fashion-and-at-bottom-of-the-screen-in-android\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Put Elements in Linear Fashion and at the Bottom of the Screen in Android - Knowband Blog | Ecommerce Modules\" \/>\n<meta property=\"og:description\" content=\"The best way to put any elements in a linear fashion in Android is to use LinearLayout\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.knowband.com\/blog\/tips\/put-elements-in-linear-fashion-and-at-bottom-of-the-screen-in-android\/\" \/>\n<meta property=\"og:site_name\" content=\"Knowband Blog | Ecommerce Modules\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Knowband\" \/>\n<meta property=\"article:published_time\" content=\"2018-11-23T09:35:19+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-11-23T10:51:16+00:00\" \/>\n<meta name=\"author\" content=\"Ajay Taneja\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@KnowbandPlugin\" \/>\n<meta name=\"twitter:site\" content=\"@KnowbandPlugin\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ajay Taneja\" \/>\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.knowband.com\\\/blog\\\/tips\\\/put-elements-in-linear-fashion-and-at-bottom-of-the-screen-in-android\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/tips\\\/put-elements-in-linear-fashion-and-at-bottom-of-the-screen-in-android\\\/\"},\"author\":{\"name\":\"Ajay Taneja\",\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/#\\\/schema\\\/person\\\/091fe95729cba0da363b4fd2a784a893\"},\"headline\":\"Put Elements in Linear Fashion and at the Bottom of the Screen in Android\",\"datePublished\":\"2018-11-23T09:35:19+00:00\",\"dateModified\":\"2018-11-23T10:51:16+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/tips\\\/put-elements-in-linear-fashion-and-at-bottom-of-the-screen-in-android\\\/\"},\"wordCount\":109,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/#organization\"},\"keywords\":[\"Android Layout\",\"linear fashion in Android\",\"linearlayout\",\"Put element in linear fashion\"],\"articleSection\":[\"Tips\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/tips\\\/put-elements-in-linear-fashion-and-at-bottom-of-the-screen-in-android\\\/\",\"url\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/tips\\\/put-elements-in-linear-fashion-and-at-bottom-of-the-screen-in-android\\\/\",\"name\":\"Put Elements in Linear Fashion and at the Bottom of the Screen in Android - Knowband Blog | Ecommerce Modules\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/#website\"},\"datePublished\":\"2018-11-23T09:35:19+00:00\",\"dateModified\":\"2018-11-23T10:51:16+00:00\",\"description\":\"The best way to put any elements in a linear fashion in Android is to use LinearLayout\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/tips\\\/put-elements-in-linear-fashion-and-at-bottom-of-the-screen-in-android\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.knowband.com\\\/blog\\\/tips\\\/put-elements-in-linear-fashion-and-at-bottom-of-the-screen-in-android\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/tips\\\/put-elements-in-linear-fashion-and-at-bottom-of-the-screen-in-android\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Put Elements in Linear Fashion and at the Bottom of the Screen in Android\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/#website\",\"url\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/\",\"name\":\"Knowband Blog | Ecommerce Modules\",\"description\":\"Magento, Prestashop, Opencart, Shopify\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/#organization\",\"name\":\"Knowband Blog | Ecommerce Modules\",\"url\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/09\\\/cropped-knowband_logo-v2.png\",\"contentUrl\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/09\\\/cropped-knowband_logo-v2.png\",\"width\":153,\"height\":61,\"caption\":\"Knowband Blog | Ecommerce Modules\"},\"image\":{\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/Knowband\",\"https:\\\/\\\/x.com\\\/KnowbandPlugin\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/fr\\\/#\\\/schema\\\/person\\\/091fe95729cba0da363b4fd2a784a893\",\"name\":\"Ajay Taneja\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/wp-content\\\/plugins\\\/wp-user-avatar\\\/deprecated\\\/wp-user-avatar\\\/images\\\/wpua-96x96.png\",\"url\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/wp-content\\\/plugins\\\/wp-user-avatar\\\/deprecated\\\/wp-user-avatar\\\/images\\\/wpua-96x96.png\",\"contentUrl\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/wp-content\\\/plugins\\\/wp-user-avatar\\\/deprecated\\\/wp-user-avatar\\\/images\\\/wpua-96x96.png\",\"caption\":\"Ajay Taneja\"},\"url\":\"https:\\\/\\\/www.knowband.com\\\/blog\\\/author\\\/ataneja\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Put Elements in Linear Fashion and at the Bottom of the Screen in Android - Knowband Blog | Ecommerce Modules","description":"The best way to put any elements in a linear fashion in Android is to use LinearLayout","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.knowband.com\/blog\/tips\/put-elements-in-linear-fashion-and-at-bottom-of-the-screen-in-android\/","og_locale":"en_US","og_type":"article","og_title":"Put Elements in Linear Fashion and at the Bottom of the Screen in Android - Knowband Blog | Ecommerce Modules","og_description":"The best way to put any elements in a linear fashion in Android is to use LinearLayout","og_url":"https:\/\/www.knowband.com\/blog\/tips\/put-elements-in-linear-fashion-and-at-bottom-of-the-screen-in-android\/","og_site_name":"Knowband Blog | Ecommerce Modules","article_publisher":"https:\/\/www.facebook.com\/Knowband","article_published_time":"2018-11-23T09:35:19+00:00","article_modified_time":"2018-11-23T10:51:16+00:00","author":"Ajay Taneja","twitter_card":"summary_large_image","twitter_creator":"@KnowbandPlugin","twitter_site":"@KnowbandPlugin","twitter_misc":{"Written by":"Ajay Taneja","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.knowband.com\/blog\/tips\/put-elements-in-linear-fashion-and-at-bottom-of-the-screen-in-android\/#article","isPartOf":{"@id":"https:\/\/www.knowband.com\/blog\/tips\/put-elements-in-linear-fashion-and-at-bottom-of-the-screen-in-android\/"},"author":{"name":"Ajay Taneja","@id":"https:\/\/www.knowband.com\/blog\/fr\/#\/schema\/person\/091fe95729cba0da363b4fd2a784a893"},"headline":"Put Elements in Linear Fashion and at the Bottom of the Screen in Android","datePublished":"2018-11-23T09:35:19+00:00","dateModified":"2018-11-23T10:51:16+00:00","mainEntityOfPage":{"@id":"https:\/\/www.knowband.com\/blog\/tips\/put-elements-in-linear-fashion-and-at-bottom-of-the-screen-in-android\/"},"wordCount":109,"commentCount":0,"publisher":{"@id":"https:\/\/www.knowband.com\/blog\/fr\/#organization"},"keywords":["Android Layout","linear fashion in Android","linearlayout","Put element in linear fashion"],"articleSection":["Tips"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.knowband.com\/blog\/tips\/put-elements-in-linear-fashion-and-at-bottom-of-the-screen-in-android\/","url":"https:\/\/www.knowband.com\/blog\/tips\/put-elements-in-linear-fashion-and-at-bottom-of-the-screen-in-android\/","name":"Put Elements in Linear Fashion and at the Bottom of the Screen in Android - Knowband Blog | Ecommerce Modules","isPartOf":{"@id":"https:\/\/www.knowband.com\/blog\/fr\/#website"},"datePublished":"2018-11-23T09:35:19+00:00","dateModified":"2018-11-23T10:51:16+00:00","description":"The best way to put any elements in a linear fashion in Android is to use LinearLayout","breadcrumb":{"@id":"https:\/\/www.knowband.com\/blog\/tips\/put-elements-in-linear-fashion-and-at-bottom-of-the-screen-in-android\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.knowband.com\/blog\/tips\/put-elements-in-linear-fashion-and-at-bottom-of-the-screen-in-android\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.knowband.com\/blog\/tips\/put-elements-in-linear-fashion-and-at-bottom-of-the-screen-in-android\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.knowband.com\/blog\/fr\/"},{"@type":"ListItem","position":2,"name":"Put Elements in Linear Fashion and at the Bottom of the Screen in Android"}]},{"@type":"WebSite","@id":"https:\/\/www.knowband.com\/blog\/fr\/#website","url":"https:\/\/www.knowband.com\/blog\/fr\/","name":"Knowband Blog | Ecommerce Modules","description":"Magento, Prestashop, Opencart, Shopify","publisher":{"@id":"https:\/\/www.knowband.com\/blog\/fr\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.knowband.com\/blog\/fr\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.knowband.com\/blog\/fr\/#organization","name":"Knowband Blog | Ecommerce Modules","url":"https:\/\/www.knowband.com\/blog\/fr\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.knowband.com\/blog\/fr\/#\/schema\/logo\/image\/","url":"https:\/\/www.knowband.com\/blog\/wp-content\/uploads\/2016\/09\/cropped-knowband_logo-v2.png","contentUrl":"https:\/\/www.knowband.com\/blog\/wp-content\/uploads\/2016\/09\/cropped-knowband_logo-v2.png","width":153,"height":61,"caption":"Knowband Blog | Ecommerce Modules"},"image":{"@id":"https:\/\/www.knowband.com\/blog\/fr\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Knowband","https:\/\/x.com\/KnowbandPlugin"]},{"@type":"Person","@id":"https:\/\/www.knowband.com\/blog\/fr\/#\/schema\/person\/091fe95729cba0da363b4fd2a784a893","name":"Ajay Taneja","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.knowband.com\/blog\/wp-content\/plugins\/wp-user-avatar\/deprecated\/wp-user-avatar\/images\/wpua-96x96.png","url":"https:\/\/www.knowband.com\/blog\/wp-content\/plugins\/wp-user-avatar\/deprecated\/wp-user-avatar\/images\/wpua-96x96.png","contentUrl":"https:\/\/www.knowband.com\/blog\/wp-content\/plugins\/wp-user-avatar\/deprecated\/wp-user-avatar\/images\/wpua-96x96.png","caption":"Ajay Taneja"},"url":"https:\/\/www.knowband.com\/blog\/author\/ataneja\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.knowband.com\/blog\/wp-json\/wp\/v2\/posts\/22879","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.knowband.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.knowband.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.knowband.com\/blog\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/www.knowband.com\/blog\/wp-json\/wp\/v2\/comments?post=22879"}],"version-history":[{"count":3,"href":"https:\/\/www.knowband.com\/blog\/wp-json\/wp\/v2\/posts\/22879\/revisions"}],"predecessor-version":[{"id":22886,"href":"https:\/\/www.knowband.com\/blog\/wp-json\/wp\/v2\/posts\/22879\/revisions\/22886"}],"wp:attachment":[{"href":"https:\/\/www.knowband.com\/blog\/wp-json\/wp\/v2\/media?parent=22879"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.knowband.com\/blog\/wp-json\/wp\/v2\/categories?post=22879"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.knowband.com\/blog\/wp-json\/wp\/v2\/tags?post=22879"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}