开发者

Displaying ImageView in a definite place on layout

developers. 开发者_JAVA技巧Is anybody know, what functions can I use to display an ImageView in a correct place on it`s parent Layout?


You can always use AbsoluteLayout - which is deprecated and using hardcoded coordinates is bad practice in general.

You better use some relations to other objects like 'align', 'gravity', 'weigth', etc.


Use the RelativeLayout as mentioned by others. If you want to place it in a specific location relative to its parent then the RelativeLayout does provide some degree of control such as android:layout_alignParentLeft="true" or android:layout_below="@+id/myFirstImageView", etc. These layout positions which are relative to the parent and/or relative to another view, are available as settings in xml or in code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜