Note that there are some explanatory texts on larger screens.

plurals
  1. POFrameLayout expended in runtime but its children are not updated with new values
    text
    copied!<p>In my app I use the following FrameLayout as a container for a fragment that will be a footer:</p> <pre><code>&lt;FrameLayout android:id="@+id/frameLayoutFooter" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true"/&gt; </code></pre> <p>In my activity I use the following code in order to add the fragment:</p> <pre><code>FragmentManager fm = getSupportFragmentManager(); FragmentTransaction ft = fm.beginTransaction(); mFooterFragment = new FooterFragment(); ft.add(R.id.frameLayoutFooter, mFooterFragment); ft.commit(); </code></pre> <p>And the layout of my footer fragment is:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/footerContainer" android:layout_width="fill_parent" android:layout_height="165dip" android:layout_alignParentBottom="true" android:background="#15355b" &gt; &lt;RelativeLayout android:id="@+id/relativeLayoutTopSetcion" android:layout_width="fill_parent" android:layout_height="wrap_content"&gt; ..... some buttons and imageviews here... &lt;/RelativeLayout&gt; &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/relativeLayoutBottomSetcion" android:layout_width="fill_parent" android:layout_height="350dip" android:layout_alignParentBottom="true" android:visibility="**invisible**" &gt; ..... some more imageviews and textviews here... &lt;/RelativeLayout&gt; &lt;/RelativeLayout&gt; </code></pre> <p>At some point I would like to expand the footer and put some more imageviews and textviews in it, but unfortunately all my tries have failed, the result is that the fragment's FrameLayout <strong>does get expanded but its children stays in the upper (old bottom) part even although they have alignParentBottom set to true</strong> - what i get is that the footer's height does change and its bottom newly added part is transparent, which makes me think that the <strong>its children are not updated with its new layout params.</strong> Another thing is that I do see the the change of the mRelativeLayoutBottomSetcion.setVisibility(View.VISIBLE) -but is not in the bottom (the newly expanded section) of the FrameLayout but in the bottom of the original size before expanding.</p> <p>in order to expand the fragment I used the following code from the activity this framents belongs to: </p> <pre><code>ViewGroup.LayoutParams params = mFrameLayoutFooter.getLayoutParams(); params.height = 500; mFrameLayoutFooter.requestLayout(); // setting the bootom relative layout to be visible mRelativeLayoutBottomSetcion.setVisibility(View.VISIBLE); </code></pre> <p>What am I doing wrong ?</p> <p>Is there a known UI pattern for expendable footer ?</p> <p>Thanks in advance</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload