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.
I don't know if MapView
has a non standard behavior, but I can think of different ways:
having the
MapView
inside aRelativeLayout
and usingandroid:alignParentRight="true"
having the
MapView
inside aLinearLayout
, with before it another view (I suspect you'll have one in the cyan part) set as wrap_content, and theMapView
set with weight=1. (switching the first view between GONE and VISIBLE would do the job)setting a left margin on the
MapView
.
精彩评论