layout_weight doesn't work on android when I use 0dp layout width -


i want lay map on application add text field , button on top of it. below xml file. after launch application, map shown on screen correctly text field , button not there. not shown when remove map. did miss here?

<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" android:orientation="vertical" tools:context="com.lenovo.mds.lenovopoc.mainactivity">  <com.amap.api.maps2d.mapview     android:id="@+id/map"     android:layout_width="match_parent"     android:layout_height="match_parent"/> <edittext     android:layout_width="0dp"     android:layout_height="wrap_content"     android:layout_weight="0.70" /> <button     android:layout_width="0dp"     android:layout_height="wrap_content"     android:text="button"     android:layout_weight="0.70"/> </linearlayout> 

you shouldn't use layout_weight in relativelayout. if mean use linearlayout, match_parent in mapview occupy spaces, might assign layout_weight it.


Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -