开发者

Change the width of the layout and align to the right side while clicking the button

I have to develop an Android application in t开发者_高级运维hat when I click the button in the map view, the view should shrinks to a particular width and should align to the right side. But when I click the button, the width of the mapview is reducing but it is left aligning. I tried a lot to align it to left side, but I couldn’t do it. Any idea plz. The figures are attached.

Change the width of the layout and align to the right side while clicking the button

Change the width of the layout and align to the right side while clicking the button


I don't know if MapView has a non standard behavior, but I can think of different ways:

  • having the MapView inside a RelativeLayout and using android:alignParentRight="true"

  • having the MapView inside a LinearLayout, with before it another view (I suspect you'll have one in the cyan part) set as wrap_content, and the MapView set with weight=1. (switching the first view between GONE and VISIBLE would do the job)

  • setting a left margin on the MapView.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜