<RelativeLayout 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"

   " />

<RelativeLayout 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"

   " />

info@thistimebd.com

Thursday 21st of November 07:18:19pm

Relative Layout Android App Source Code

activity_main.xml

==================


<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout 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"

    tools:context="com.sam.web.relativelayout.MainActivity">


<Button

    android:layout_centerInParent="true"

    android:id="@+id/button1Id"

    android:text="button"

    android:layout_width="wrap_content"

    android:layout_height="wrap_content" />


    <TextView

        android:layout_alignBaseline="@id/button1Id"

       

        android:layout_toRightOf="@id/button1Id"

        android:textStyle="bold"

        android:textSize="20sp"

        android:id="@+id/imageViewID"

        android:text="Hellow"

        android:layout_width="wrap_content"

        android:layout_height="wrap_content" />



</RelativeLayout>

=====================================================================


MainActivity.java

========================


package com.sam.web.relativelayout;


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);

    }

}