小编Kir*_*lla的帖子

如何在android支持设计底页中设置最大扩展高度?

我已经展示了我的底部布局,其峰值高度设置为100dp.但是,如何限制我的底页仅扩展到500dp?这是我的示例布局:

<android.support.design.widget.CoordinatorLayout
android:id="@+id/coordinator"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">

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

<android.support.v4.widget.NestedScrollView
    android:id="@+id/design_bottom_sheet"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#000000"
    app:behavior_hideable="true"
    app:behavior_peekHeight="100dp"
    app:layout_behavior="android.support.design.widget.BottomSheetBehavior">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <TextView
            android:layout_width="match_parent"
            android:layout_height="100dp"
            android:layout_marginBottom="5dp"
            android:background="#e444ff" />

        <TextView
            android:layout_width="match_parent"
            android:layout_height="100dp"
            android:layout_marginBottom="5dp"
            android:background="#e444ff" />

        <TextView
            android:layout_width="match_parent"
            android:layout_height="100dp"
            android:layout_marginBottom="5dp"
            android:background="#e444ff" />

    </LinearLayout>

</android.support.v4.widget.NestedScrollView>

<android.support.design.widget.FloatingActionButton
    android:id="@+id/fab"
    android:layout_margin="@dimen/activity_horizontal_margin"
    app:layout_anchor="@+id/design_bottom_sheet"
    app:layout_anchorGravity="top|right|end"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />

</android.support.design.widget.CoordinatorLayout>
Run Code Online (Sandbox Code Playgroud)

除了我的问题,我怎么能禁止用户上下拖动底部纸张?

android android-support-design

28
推荐指数
3
解决办法
3万
查看次数

ccoc()在cocos2dx版本3.2上的等效功能是什么

我目前正在开发一个游戏,也可以在这个链接的教程中看到http://www.raywenderlich.com/33752/cocos2d-x-tutorial-for-ios-and-android-space-game

在我学习本教程时,我在实现在ParallaxNode上添加子节点的代码时遇到了问题.我的问题是......在给定的教程中,他使用了语句:_backgroundNode-> addChild(_spacedust1,0,dustSpeed,ccp(winSize.height/2)); 在他的parralaxnode上添加孩子.我想知道的是cocos2dx版本3.2上的等效ccp()函数.因为当我尝试编译游戏应用程序时,会出现错误.

cocos2d-x

1
推荐指数
1
解决办法
1484
查看次数