小编tha*_*sis的帖子

底部有移动浮动动作按钮

我想使用支持库中的Bottom-sheet和两个浮动操作按钮(FABS)来显示图片.关键是我还希望两个FABS与底页一起移动,如图1和图2所示.我必须使用的基本布局是什么以及如何使底板上的FABS粘性?

图片1 图2

UPDATE

<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:orientation="vertical"
tools:context=".MainActivity">

<android.support.design.widget.AppBarLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:theme="@style/AppTheme.AppBarOverlay">

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        app:popupTheme="@style/AppTheme.PopupOverlay"/>

</android.support.design.widget.AppBarLayout>


<android.support.design.widget.CoordinatorLayout
    android:id="@+id/main_content"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

      <!-- my context here -->

    </LinearLayout>

      <!-- bottomsheet -->
    <FrameLayout
        android:id="@+id/bottom_sheet"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#ff0000"
        app:behavior_hideable="true"
        app:layout_behavior="android.support.design.widget.BottomSheetBehavior">

        <include layout="@layout/navigation_info" />

    </FrameLayout>

    <!-- FABS -->

    <!-- wrap to primary fab to extend the height -->

    <LinearLayout
        android:id="@+id/primary_wrap"
        android:layout_width="wrap_content"
        android:layout_height="88dp"
        app:layout_anchor="@id/bottom_sheet"
        app:layout_anchorGravity="top|end">

        <android.support.design.widget.FloatingActionButton
            android:id="@+id/primary"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"

            android:layout_margin="@dimen/fab_margin"
            android:src="@android:drawable/ic_delete"/>
    </LinearLayout>


    <!-- Pin secondary …
Run Code Online (Sandbox Code Playgroud)

android android-layout floating-action-button bottom-sheet

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

在 git 上重命名文件并保留历史记录

是否可以使用 Github 桌面而不是使用 git shell 重命名文件并保留它的历史记录?

git github-desktop

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

从相机位置获取 LatLngBouds

我想要获取LatLngGoogle 地图框架的右上角和左下角的 来创建LatLngBounds. 可以这样做吗?

地图

android google-maps

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

如何在jQuery中使用参数调用JavaScript函数?

这是在单击按钮时调用JS函数的简单示例.在这段代码中我使用了onclick方法,但我想学习如何使用jQuery调用相同的方法.

<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script> 
$(document).ready(function(){
    $("#but").click(
        doubleSize($("#inpt").val()); // **maybe not correct here**
    );
});
function doubleSize(x)
{
    //some code make a number double size
}
</script>
</head>

<body>

<input id="inpt" type="text">
<button id="but" type="button" onclick="doubleSize(document.getElementById('inpt').value)" >click me !!</button>
<div><span id="result"></span>
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

html javascript jquery

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

错误:com.android.dex.DexIndexOverflowException:方法ID不在[0,0xffff]中:65536

这是我的build.gradle

android {
    ...
    }
    compileSdkVersion 23
    buildToolsVersion "23.0.1"
    defaultConfig {
        ...
        minSdkVersion 19
        targetSdkVersion 23
        versionCode 2
        versionName "1.4.0"
        multiDexEnabled = true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.config
        }
    }
}

repositories {
    mavenCentral()
    flatDir {
        dirs 'libs'
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile(name: 'identitytoolkit-api11', ext: 'aar')
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:design:23.1.1'
    compile 'com.google.android.gms:play-services:8.3.0'
    compile ([group: 'com.google.api-client', name: 'google-api-client-android', version: '1.21.0'])
    compile 'com.android.support:multidex:1.0.0'
}
Run Code Online (Sandbox Code Playgroud)

我收到此错误:

Error:Execution failed for …
Run Code Online (Sandbox Code Playgroud)

java android gradle dex

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

如何将多维数组与数组列表一起使用?

我想从sql查询添加一些记录,但输出不正确.始终返回最后一条记录.

正确的清单是:

约翰

缺口

玛丽

,但总是回归乔.

这是添加元素的方法:

public ArrayList<String[][]> getFiledArrayList()
{
   // ArrayList<String[][]> fieldsList = new  ArrayList<>();
    String[][] tempRow = new String[1][2];
    ResultSet result;

    String sql = "select id, name_of from field";
    result = database.exeQueryStatement(sql);
    try 
    {
        while(result.next())
        {
            tempRow[0][0] = result.getString("id");
           // System.out.println(tempRow[0][0]);
            tempRow[0][1] = result.getString("name_of");
           // System.out.println(tempRow[0][1]);
            fieldsList.add(tempRow);
            System.out.println(fieldsList.get(0)[0][1]);
        }
    } 
    catch (SQLException ex) 
    {
        Logger.getLogger(FieldManage.class.getName()).log(Level.SEVERE, null, ex);
    }

    return fieldsList;
Run Code Online (Sandbox Code Playgroud)

我把idname_of一个String[1][2]表,我想显示name_of在的JComboBox.Ι要进行插入和观赏name_ofid

FieldManage fieldmanage = new …
Run Code Online (Sandbox Code Playgroud)

java

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