java - Android Soft Keyboard Disrupt's My Layout -


i know ton of questions on topic have been asked none seem work me. have linear layout an edit text , icons below when keyboard pops covers icons , half edit text.

my manifest file:

<activity     android:name="com.social.pages.post"     android:windowsoftinputmode="statevisible|adjustresize"     android:screenorientation="portrait" > </activity> 

my layout file:

<relativelayout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:background="@color/feed_bg" >      <linearlayout         android:id="@+id/stories_post_entire"         android:layout_width="fill_parent"         android:layout_height="wrap_content"         android:layout_below="@+id/story_post"         android:layout_centerhorizontal="true"         android:background="@drawable/bg_parent_rounded_corner"         android:orientation="vertical"         android:paddingbottom="@dimen/feed_item_padding_top_bottom"         android:paddingtop="@dimen/feed_item_padding_top_bottom" >          <!--              <linearlayout             android:id="@+id/stories_post_text"             android:layout_width="fill_parent"             android:layout_height="300dp"             android:layout_margintop="15dp"             android:orientation="horizontal"             android:paddingbottom="@dimen/feed_item_padding_top_bottom"             android:paddingleft="@dimen/feed_item_padding_left_right"             android:paddingright="@dimen/feed_item_padding_left_right" >         -->          <edittext             android:id="@+id/stories_post_story"             android:layout_width="fill_parent"             android:layout_height="300dp"             android:layout_marginleft="5dp"             android:layout_marginright="5dp"             android:layout_margintop="10dp"             android:background="@drawable/bg_parent_rounded_corner"             android:ems="10"             android:gravity="top"             android:hint="tell story..."             android:padding="10dp"             android:paddingleft="10dp"             android:scrollbars="vertical"             android:typeface="serif" />          <linearlayout             android:id="@+id/stories_post_bar"             android:layout_width="fill_parent"             android:layout_height="wrap_content"             android:orientation="horizontal"             android:layout_margintop="10dp"             android:paddingleft="@dimen/feed_item_padding_left_right"             android:paddingright="@dimen/feed_item_padding_left_right" >              <imageview                 android:id="@+id/stories_post_tag"                 android:layout_width="wrap_content"                 android:layout_height="wrap_content"                 android:scaletype="fitcenter"                 android:src="@drawable/tag" />              <imageview                 android:id="@+id/stories_post_take_pic"                 android:layout_width="wrap_content"                 android:layout_height="wrap_content"                 android:layout_marginleft="30dp"                 android:scaletype="fitcenter"                 android:src="@drawable/take_pic" />         </linearlayout>     </linearlayout>      <!-- </linearlayout> -->      <button         android:id="@+id/story_post"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_alignparentright="true"         android:layout_alignparenttop="true"         android:text="post" />  </relativelayout> 

no java code has been written yet.

you're setting edittext element 300dp height prevents moving up. able fix wrapping edittext , following linearlayout (that houses images) in relativelayout. doing this, can set image-housing linearlayout alignparentbottom="true". believe desired effect.

    <?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" >      <linearlayout         android:id="@+id/stories_post_entire"         android:layout_width="fill_parent"         android:layout_height="wrap_content"         android:layout_below="@+id/story_post"         android:layout_centerhorizontal="true"         android:orientation="vertical" >          <!-- addition -->         <relativelayout             android:layout_width="match_parent"             android:layout_height="match_parent">            <edittext             android:id="@+id/stories_post_story"             android:layout_width="fill_parent"             android:layout_height="300dp"             android:layout_marginleft="5dp"             android:layout_marginright="5dp"             android:layout_margintop="10dp"             android:ems="10"             android:gravity="top"             android:hint="tell story..."             android:padding="10dp"             android:paddingleft="10dp"             android:scrollbars="vertical"             android:typeface="serif" />          <linearlayout             android:id="@+id/stories_post_bar"             android:layout_width="fill_parent"             android:layout_height="wrap_content"             android:orientation="horizontal"             android:layout_alignparentbottom="true"             android:layout_margintop="10dp" >             <!-- addition    ^^^ alignparentbottom-->              <imageview                 android:id="@+id/stories_post_tag"                 android:layout_width="wrap_content"                 android:layout_height="wrap_content"                 android:scaletype="fitcenter"                 android:src="@drawable/osumu_blur"/>              <imageview                 android:id="@+id/stories_post_take_pic"                 android:layout_width="wrap_content"                 android:layout_height="wrap_content"                 android:layout_marginleft="30dp"                 android:scaletype="fitcenter"                 android:src="@drawable/osumu_blur"/>         </linearlayout>              <!-- addition -->         </relativelayout>     </linearlayout>       <!-- </linearlayout> -->      <button         android:id="@+id/story_post"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_alignparentright="true"         android:layout_alignparenttop="true"         android:text="post" />  </relativelayout> 

note: replaced drawable src "dummy_image"


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -