{"id":13105,"date":"2019-11-28T14:38:25","date_gmt":"2019-11-28T14:38:25","guid":{"rendered":"https:\/\/ittutorial.org\/?p=13105"},"modified":"2020-01-16T08:24:20","modified_gmt":"2020-01-16T08:24:20","slug":"android-programming-5-imageview-components","status":"publish","type":"post","link":"https:\/\/ittutorial.org\/android-programming-5-imageview-components\/","title":{"rendered":"Android Programming -5 Imageview Components"},"content":{"rendered":"<p>Hi guys in this tutorial\u00a0I will talk about textview and imageview components.<\/p>\n<p>In my previous tutorial, I talked about the buton components. If you have not read it yet, I recommend you read it first.<\/p>\n<p><a href=\"https:\/\/ittutorial.org\/android-programming-4-button-component\/\">https:\/\/ittutorial.org\/android-programming-4-button-component\/<\/a><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-13112 size-large\" src=\"https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/11\/imageview-962x1024.png\" alt=\"\" width=\"800\" height=\"852\" srcset=\"https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/11\/imageview-962x1024.png 962w, https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/11\/imageview-282x300.png 282w, https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/11\/imageview-768x818.png 768w, https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/11\/imageview.png 1330w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/p>\n<p>&nbsp;<\/p>\n<pre>RelativeLayout\r\n\r\n\u00a0\u00a0\u00a0\u00a0xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\r\n\u00a0\u00a0\u00a0\u00a0android:layout_width=\"match_parent\"\r\n\u00a0\u00a0\u00a0\u00a0android:layout_height=\"match_parent\"\r\n&gt;\r\n\r\n\r\n\u00a0\u00a0\u00a0&lt;ImageView\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0android:layout_width=\"wrap_content\"\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0android:layout_height=\"wrap_content\"\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0android:layout_centerInParent=\"true\"\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0android:src=\"@mipmap\/ic_launcher\"<\/pre>\n<pre>       android:id=\"@+id\/button_id\"<\/pre>\n<pre>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/&gt; &lt;\/RelativeLayout&gt;<\/pre>\n<p>Sometimes we need to show image in our application,\u00a0in this case we can use imageview component. imageview component have a lot of\u00a0attribute . For example, we set background image with\u00a0android:src=&#8221;@mipmap\/ic_launcher&#8221;\u00a0 code,\u00a0and setting the position on the page with android:layout_centerInParent=&#8221;true&#8221; code.\u00a0 We can also define the color in the background , not just the picture.<\/p>\n<p>when you will define the imageview component, do not forget setting the id, width and height attribute.\u00a0We can this setting with the following code;<\/p>\n<pre>android:layout_width=\"wrap_content\" \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\r\nandroid:layout_height=\"wrap_content\"\r\nandroid:id=\"@+id\/button_id\"<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi guys in this tutorial\u00a0I will talk about textview and imageview components. In my previous tutorial, I talked about the buton components. If you have not read it yet, I recommend you read it first. https:\/\/ittutorial.org\/android-programming-4-button-component\/ &nbsp; RelativeLayout \u00a0\u00a0\u00a0\u00a0xmlns:android=&#8221;http:\/\/schemas.android.com\/apk\/res\/android&#8221; \u00a0\u00a0\u00a0\u00a0android:layout_width=&#8221;match_parent&#8221; \u00a0\u00a0\u00a0\u00a0android:layout_height=&#8221;match_parent&#8221; &gt; \u00a0\u00a0\u00a0&lt;ImageView \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0android:layout_width=&#8221;wrap_content&#8221; \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0android:layout_height=&#8221;wrap_content&#8221; \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0android:layout_centerInParent=&#8221;true&#8221; \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0android:src=&#8221;@mipmap\/ic_launcher&#8221; android:id=&#8221;@+id\/button_id&#8221; \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/&gt; &lt;\/RelativeLayout&gt; Sometimes we need to show &hellip;<\/p>\n","protected":false},"author":44,"featured_media":8094,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4],"tags":[7017,7011,7007,7005,7015,4746,7009,7008,7010,7024,3319,7021,7026,7016,7022,7025,7018,7019,7020,7006,7014,7023,7012,7013],"class_list":["post-13105","post","type-post","status-publish","format-standard","has-post-thumbnail","","category-android","tag-android-app-development","tag-android-app-development-software","tag-android-button-color-xml","tag-android-coding","tag-android-development-basics","tag-android-programming","tag-android-programming-language","tag-android-programming-tutorial","tag-android-programming-with-java","tag-android-project","tag-android-studio","tag-android-studio-basic-example","tag-android-studio-basic-projects","tag-android-studio-first-app","tag-android-studio-lessons","tag-android-studio-projects","tag-android-studio-tutorial","tag-android-studio-tutorial-for-beginners","tag-android-studio-tutorial-point","tag-android-xml-coding","tag-create-mobile-app-without-coding","tag-java-android-developer","tag-mobil-app-maker","tag-mobile-application-make"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/04\/featured-860x280.png","jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/posts\/13105","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/users\/44"}],"replies":[{"embeddable":true,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/comments?post=13105"}],"version-history":[{"count":3,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/posts\/13105\/revisions"}],"predecessor-version":[{"id":13659,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/posts\/13105\/revisions\/13659"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/media\/8094"}],"wp:attachment":[{"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/media?parent=13105"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/categories?post=13105"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/tags?post=13105"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}