put image in an absolute position in a linear layout

心已入冬 提交于 2019-12-12 03:49:07

问题


I have an android application I created with a menu with a set of buttons that are ordered one after the other.

I have a logo Icon that I want to pin to the bottom right corner of the page and to add it a margin. how can I do that ?

the page itself is in a LinearLayout. but I hope it is possible to add one element with an absoute position! :)

I use android 2.2 sdk

thank you


回答1:


Use Nested Layouts..

<RelativeLayout>
  <LinearLayout>
    Place your elements and menu here.
  </LinearLayout>
  <ImageView
    android:layout_alignParentBottom="true" />
</RelativeLayout>


来源:https://stackoverflow.com/questions/15063282/put-image-in-an-absolute-position-in-a-linear-layout

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!