Xamarin.android 在xamarin android中以编程方式设置mapfragment的高度
我正在使用xamarin android 我想以编程方式设置下面片段标记的高度Xamarin.android 在xamarin android中以编程方式设置mapfragment的高度,xamarin.android,Xamarin.android,我正在使用xamarin android 我想以编程方式设置下面片段标记的高度 <fragment android:id="@+id/googlemap" android:layout_width="match_parent" android:layout_height="match_parent" class="com.google.android.gms.ma
<fragment
android:id="@+id/googlemap"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.MapFragment"/>
谁能给我提个建议吗
提前感谢。试试这个:
var mapFragment = (MapFragment)FragmentManager.FindFragmentById(Resource.Id.googlemap);
mapFragment.View.LayoutParameters.Height = 500; //The size you decide
mapFragment.View.LayoutParameters.Width = 500; //The size you decide
试试这个:
var mapFragment = (MapFragment)FragmentManager.FindFragmentById(Resource.Id.googlemap);
mapFragment.View.LayoutParameters.Height = 500; //The size you decide
mapFragment.View.LayoutParameters.Width = 500; //The size you decide