android - How to align ViewGroup to the bottom of the screen -


so, have activity launched dialog (theme.dialog). use play video, dimming background, , looks pretty cool... it's centered on screen , don't know how move bottom programmatically.

<relativelayout xmlns:android="http://schemas.android.com/apk/res/android"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:id="@+id/lr_layout"             android:background="#ff000000"             android:padding="0dp" >   <relativelayout     android:id="@+id/lr_progresscontainer"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:background="#ff000000">      <progressbar android:id="@+id/lr_progress"       android:layout_width="wrap_content"       android:layout_height="wrap_content"       android:layout_centerinparent="true"       android:background="@android:color/black"       style="@android:style/widget.progressbar.large" />      <view android:id="@+id/disableshape"     android:layout_width="fill_parent"     android:layout_height="fill_parent"     android:padding="0dp"     android:visibility="gone"     android:background="#cc000000"      /> </relativelayout>  </relativelayout> 

and add video player programmatically (view 3rd party).

i've tried this:

layout = (viewgroup) findviewbyid(r.id.lr_layout); layout.sety(0); 

and this:

relativelayout.layoutparams adviewlayoutparams = new relativelayout.layoutparams(relativelayout.layoutparams.match_parent, relativelayout.layoutparams.match_parent); adviewlayoutparams.addrule(relativelayout.align_bottom); layout.addview(adview, adviewlayoutparams); 

but video still in center.

any idea?

thanks!

try putting in oncreate method.

windowmanager.layoutparams lp = getwindow().getattributes(); lp.gravity = gravity.bottom; getwindow().set attributes(lp);


Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -