【问题标题】:Map Fragment adjust size地图片段调整大小
【发布时间】:2017-07-29 03:51:13
【问题描述】:

我有全屏视图的地图片段。并且摘要弹出窗口在屏幕底部是不可见的。

  <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 所做的那样。

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

【问题讨论】:

  • 我已否决并将您的辱骂性言论报告给版主。请尽量不要在这里使用 txtspk - 它相当懒惰。此外,您应该感谢有人花时间改进您的问题。

标签: java android supportmapfragment


【解决方案1】:

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

【讨论】:

  • 我不认为这个解决方案的新库。我认为一些数学上的解决方法就可以了。
【解决方案2】:
getFragmentManager().findFragmentById(R.id.ap_fragement).getView().setLayoutParams();

将调整片段大小。

【讨论】:

    猜你喜欢
    • 2014-10-05
    • 2017-12-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-02-22
    • 1970-01-01
    • 1970-01-01
    • 2023-04-01
    相关资源
    最近更新 更多