Create a ImageView and Image Button LayOut In Android - LearnHowToCode SarkariResult.com Interview Questions and Answers LearnHowToCodeOnline
Create a ImageView and Image Button LayOut In Android

Create a ImageView and Image Button LayOut In Android

In this tutorial you can learn, How to Create an ImageView and Image Button LayOut In Android
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:weightSum="9" 
   tools:context=".MainActivity">
    <LinearLayout 
       android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1" 
       android:weightSum="4">
        <ImageButton
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:background="@drawable/ic_home_black" />
        <ImageButton
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:background="@drawable/ic_notifications" />
        <ImageButton
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:background="@drawable/ic_message" />
        <ImageButton 
           android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1" 
           android:background="@drawable/ic_settings" />
 </LinearLayout>
    <LinearLayout 
       android:layout_width="match_parent" 
       android:layout_height="0dp" 
       android:layout_weight="4" 
       android:background="@drawable/akshay">


    </LinearLayout>
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1" 
       android:weightSum="3">

        <ImageButton 
           android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1" 
           android:background="@drawable/ic_skip" />

        <ImageButton
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1" 
           android:background="@drawable/ic_stop" />
        <ImageButton 
           android:layout_width="0dp"
            android:layout_height="match_parent" 
           android:layout_weight="1" 
           android:background="@drawable/ic_play_arrow" />
    </LinearLayout>
</LinearLayout>
MainActivity.java
package com.example.imageview;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

public class MainActivity extends AppCompatActivity {

    @Override    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

}

About Mariano

I'm Ethan Mariano a software engineer by profession and reader/writter by passion.I have good understanding and knowledge of AngularJS, Database, javascript, web development, digital marketing and exploring other technologies related to Software development.

0 comments:

Featured post

Political Full Forms List

Acronym Full Form MLA Member of Legislative Assembly RSS Really Simple Syndication, Rashtriya Swayamsevak Sangh UNESCO United Nations E...

Powered by Blogger.