小编Eri*_*ric的帖子

BottomSheetDialog 没有显示?

我正在尝试实现新的BottomSheetDialog,但是当我调用.show()它时显示背景阴影而不是我的布局。

这是我的代码

<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/white">

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:paddingTop="4dp"
            android:paddingBottom="4dp"
            android:paddingStart="8dp"
            android:paddingEnd="8dp">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Notes"
                android:layout_alignParentStart="true"
                android:layout_centerVertical="true"
                android:textColor="@android:color/black"/>

            <Switch
                android:id="@+id/notes"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:layout_alignParentEnd="true"/>

        </RelativeLayout>

    </RelativeLayout>

</android.support.v4.widget.NestedScrollView>
Run Code Online (Sandbox Code Playgroud)

进而:

    mSettingsDialog = new BottomSheetDialog(this);
    View v = getLayoutInflater().inflate(R.layout.reader_settings,  null);
    mSettingsDialog.setContentView(v);
    mSettingsDialog.show();
Run Code Online (Sandbox Code Playgroud)

我该如何解决这个问题?

android material-design bottom-sheet

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

Android Studio使用Java 8编译项目吗?

我正在尝试使用Java 8编译项目。

如图所示,我已经设置了正确的jdk:

JDK位置

还更改了目标版本:

目标版本

但是我仍然遇到错误: compileSdkVersion'android-24'需要JDK 1.8或更高版本进行编译。

我哪里错了?

编辑:我在Ubuntu 12.04上

java-8 android-studio

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