I have Two Image Views Defined in Xml. I want to Change the Position of One of them Dynamically while the Other remains constant.?? Any Suggestions. Thanx.
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
Use the layout property like this:
Where the
l
stands for left,t
for top, etc.Lets assume your imageView1 which would remain Constant is center aligned in parent. And Your Second ImageView imageView2 is aligned left to imageView1, and now you want to align it to below of imageView1. Use following to achieve the same,
RelativeLayout.LayoutParams params = imageView2.getLayoutParams(); param.addRule(RelativeLayout.BELOW, R.id.imageView1); imageView2.setLayoutParams(params);
Yes off course, this is damn possible.Use LayouParam
Setting Margin
You can do it by providing new rules for
RelativeLayout.LayoutParams
. Just do something like this: