android - Relativelayout not wrapping its content -


i want inner relativelayout wrap it's content , stay below view element. why isn't behaving pic below?

my layout.xml

<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="match_parent"     android:layout_height="match_parent">     <view         android:id="@+id/linearlayout"         android:layout_above="@+id/input_layout"         android:layout_width="match_parent"         android:layout_height="match_parent"/>      <relativelayout         android:id="@+id/input_layout"         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:layout_alignparentbottom="true"         android:background="#ebebeb">          <edittext             android:id="@+id/edittext"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:layout_alignparentbottom="true"             android:layout_alignparentleft="true"             android:layout_alignparentstart="true"             android:layout_toleftof="@+id/imageview13"             android:layout_tostartof="@+id/imageview13"             android:background="@android:color/white"             android:padding="8dp" />          <imageview             android:id="@+id/imageview13"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:layout_alignparentbottom="true"             android:layout_alignparentend="true"             android:layout_alignparentright="true"             android:src="@drawable/ic_m_send" />      </relativelayout>  </relativelayout> 

enter image description here

remove android:layout_alignparentbottom="true" both edittext , imageview solve proble.

your relativelayout have android:layout_alignparentbottom="true" , if set same it's child set layout height full screen.

note cannot have circular dependency between size of relativelayout , position of children. example, cannot have relativelayout height set wrap_content , child set align_parent_bottom

class document


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -