我最近使用了android.support.design.widget.BottomSheetDialogFragment.我想做一些类似于谷歌联系人应用程序的东西,它的BottomSheet可以覆盖工具栏和状态栏.但是,当我使用BottomSheetDialogFragment实现它时,结果如下:

如您所见,活动的工具栏仍然可见.这是我的代码BottomSheetDialogFragment:
public class KeyDetailFragment extends BottomSheetDialogFragment {
private BottomSheetBehavior.BottomSheetCallback mBottomSheetBehaviorCallback = new BottomSheetBehavior.BottomSheetCallback() {
@Override
public void onStateChanged(@NonNull View bottomSheet, int newState) {
if (newState == BottomSheetBehavior.STATE_HIDDEN) {
dismiss();
}
}
@Override
public void onSlide(@NonNull View bottomSheet, float slideOffset) {
}
};
@Override
public void setupDialog(Dialog dialog, int style) {
super.setupDialog(dialog, style);
View contentView = View.inflate(getActivity(), R.layout.sheet_key, null);
dialog.setContentView(contentView);
View parent = (View) contentView.getParent();
parent.setFitsSystemWindows(true);
BottomSheetBehavior bottomSheetBehavior = BottomSheetBehavior.from(parent);
contentView.measure(0, 0);
bottomSheetBehavior.setPeekHeight(contentView.getMeasuredHeight());
CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) parent.getLayoutParams(); …Run Code Online (Sandbox Code Playgroud) 我是 osx 的新手,我遇到了一些问题。我尝试生成文件,但提出了:
error: unknown type name 'u_char'; did you mean 'char'?
我提到 C PCAP 库未知类型错误,将-D_BSD_SOURCECFLAGS添加到我的 makefile,但它没有帮助。我错过了什么?
编辑:
这是产生错误的代码:
char *computePwd(const u_char *md5) {
static char buf[16];
unsigned char tmp[40];
int tmpl=0;
tmpl = strlen(userName);
strcpy((char*)tmp, userName);
memcpy(tmp + tmpl, md5, 16);
tmpl += 16;
memcpy(buf, ComputeHash(tmp, tmpl), 16);
memset(tmp, 0, 16);
strcpy((char*)tmp, password);
int i;
for (i=0; i<16; ++i)
buf[i] ^= tmp[i];
return buf;
}
Run Code Online (Sandbox Code Playgroud) 我是python的新手,在我的mac上使用Python3.5.1时发现了一个令人困惑的结果,我只是在终端中运行了这个命令
1 // 0.05
Run Code Online (Sandbox Code Playgroud)
但是,它在我的屏幕上打印了19.0.从我的观点来看,它应该是20.有人可以解释这里发生了什么吗?我已经知道'//'类似于math.floor()函数.但我还是无法理解这一点.
我是Android开发中的OpenGL ES的新手.我在研究期间发现了两种类型的纹理:
GL_TEXTURE_2DGL_TEXTURE_EXTERNAL_OES有人告诉我,他们彼此不兼容.
我有两个问题:
GL_TEXTURE_EXTERNAL_OES质地必须是YUV格式?如果没有,是什么决定数据格式?我尝试为我的 Android 项目提供 WebAssembly 功能v8 7.2。我已成功导入v8为静态库。但我遇到了一个问题,WebAssembly 既没有调用then也没有catch回调。下面是我的代码:
std::unique_ptr<v8::Platform> platform;
v8::Isolate *isolate;
v8::Persistent<v8::Context> persistentContext;
void runMain();
void runScript();
void _log(const v8::FunctionCallbackInfo<v8::Value>& info) {
v8::String::Utf8Value utf(isolate, info[0].As<v8::String>());
__android_log_print(ANDROID_LOG_DEBUG, "V8Native", "%s",*utf);
}
void JNICALL
Java_com_hustunique_v8demoapplication_MainActivity_initV8(JNIEnv *env, jobject /* this */) {
// Initialize V8.
v8::V8::InitializeICU();
platform = v8::platform::NewDefaultPlatform();
v8::V8::InitializePlatform(&(*platform.get()));
v8::V8::Initialize();
runMain();
}
void runMain() {
// Create a new Isolate and make it the current one.
v8::Isolate::CreateParams create_params;
create_params.array_buffer_allocator = v8::ArrayBuffer::Allocator::NewDefaultAllocator();
isolate = v8::Isolate::New(create_params);
// …Run Code Online (Sandbox Code Playgroud) android ×2
bottom-sheet ×1
c ×1
c++ ×1
embedded-v8 ×1
gnu-make ×1
javascript ×1
makefile ×1
opengl-es ×1
python ×1
v8 ×1
webassembly ×1