当面板被设置为默认面板的高度如何停止umano

当面板被设置为默认面板的高度如何停止umano

本文介绍了当面板被设置为默认面板的高度如何停止umano AndroidSlidingUpPanel的主要内容调整大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用在我的Andr​​oid项目。在这里,我使用谷歌地图作为我的主要内容。遵循的是相关的XML文件。

I am using umano AndroidSlidingUpPanel in my Android project. Here I am using Google Map as my main content. Follow is the relevant XML file.

<RelativeLayout 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"
    tools:context=".DemoActivity" >

    <com.mypkg.name.SlidingUpPanelLayout
        xmlns:sothree="http://schemas.android.com/apk/res-auto"
        android:id="@+id/sliding_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_gravity="bottom"
        sothree:collapsedHeight="78dp"
        sothree:dragView="@+id/linLayout"
        sothree:shadowHeight="4dp" >

        <FrameLayout
            android:id="@+id/activity_single_fragment_content"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="#0000FF" >

            <fragment
                android:id="@+id/map_fragment"
                android:name="com.google.android.gms.maps.SupportMapFragment"
                android:layout_width="match_parent"
                android:layout_height="match_parent" />
        </FrameLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="#eee"
            android:clickable="true"
            android:focusable="false"
            android:orientation="vertical" >

            <RelativeLayout
                android:id="@+id/drawerListItemProfile_relativeLayout"
                android:layout_width="match_parent"
                android:layout_height="80dp"
                android:background="@drawable/drawer_profile_selector" >

                <FrameLayout
                    android:id="@+id/imgFrameLayout"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentLeft="true"
                    android:layout_centerVertical="true"
                    android:layout_margin="5dp" >

                    <ImageView
                        android:id="@+id/drawerListItemProfile_imageView"
                        android:layout_width="@dimen/nav_profile_circle_size"
                        android:layout_height="@dimen/nav_profile_circle_size"
                        android:contentDescription="@string/contentDescription_drawer_profile_pic"
                        android:scaleType="centerCrop"
                        android:src="@drawable/profilepic" />
                </FrameLayout>
            </RelativeLayout>

            <ImageView
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="1"
                android:scaleType="fitStart"
                android:src="@null" >
            </ImageView>
        </LinearLayout>
    </com.mypkg.name.SlidingUpPanelLayout>

</RelativeLayout>

但活动开始时,我的面板的默认高度设置为0。

But when the Activity begins I set the default height of the panel to 0.

slidingUpPanelLayout.setPanelHeight(0);

在地图上的标记被点击我设置面板默认的高度。

When a Marker on the map is clicked I set panel to default height.

slidingUpPanelLayout.setPanelHeight(defaultPanelHeight);

和再次,当我点击地图上(而不是一个标记)面板高度设置为0。当我这样做,地图是调整大小。我怎样才能停止。我想这个功能的工作原理就像在谷歌地图在Android移动设备。

And again, when I click on the map (not on a Marker) panel height is set to 0. When I am doing this, Map is re-sizing. How can I stop that. I want this feature works just as in Google Maps in Android mobile device.

推荐答案

Bazinga;)我做到了。

Bazinga ;) I did it.

只是评论495线(https://github.com/umano/AndroidSlidingUpPanel/blob/master/library/src/com/sothree/slidinguppanel/SlidingUpPanelLayout.java)这是;

Just comment 495 line in (https://github.com/umano/AndroidSlidingUpPanel/blob/master/library/src/com/sothree/slidinguppanel/SlidingUpPanelLayout.java) which is;

height -= panelHeight;

和你是好去。但是,当你使用谷歌地图放大的放大缩小按钮,如果你使用它们,你会得到可能的缺点。即,向上滑动抽屉将覆盖这些按钮。但在真正的谷歌地图,它不会发生。

and you are good to go. But you will get possible drawback when you use Google Maps zoom-in zoom-out buttons if you use them. That is, the sliding up drawer will cover those buttons. But in real Google Maps it wont happen.

这篇关于当面板被设置为默认面板的高度如何停止umano AndroidSlidingUpPanel的主要内容调整大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 20:43