2017-07-29 71 views
-2

我有全屏视图的地图片段。并在屏幕底部隐藏汇总弹出窗口。地图片段调整大小

<fragment xmlns:android="http://schemas.android.com/apk/res/android" 
     xmlns:map="http://schemas.android.com/apk/res-auto" 
     xmlns:tools="http://schemas.android.com/tools" 
     android:id="@+id/ap_fragement" 
     android:name="com.google.android.gms.maps.SupportMapFragment" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     tools:context="com.apps.MainActivity" /> 

<!--Summary View --> 
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
     android:orientation="vertical" 
     android:id="@+id/summary_popup" 
     android:visibility="invisible" 
     android:padding="10dp" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:background="#ffffffff"> 

<TextView 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:text="@string/title" 
      android:textSize="16sp" 
      android:textColor="#1A237E"/> 

....... 


</LinearLayout> 

在地图加载摄像头的看法是设备屏幕的中心,当我让我的摘要页面看到它加载在设备屏幕的底部。

如何将地图片段移动到设备屏幕的上半部分以显示选定的用户位置?像UBER一样,当我们要求乘坐时。

我想移动相机或在片段视图上设置一些不同的布局大小。

+0

我已经下调并向版主报告了您的辱骂性言论。请尽量避免从这里txtspk - 这是相当懒惰。此外,您应该感谢有人花时间改善您的问题。 – halfer

回答

0
getFragmentManager().findFragmentById(R.id.ap_fragement).getView().setLayoutParams(); 

将调整片段大小。

0

有多种方法可以做到这一点。您可以重新安排布局,并动态管理事物或查看this库。

+0

我不认为这个解决方案的新库。我认为一些数学解决方法会做。 –