0
package com.darkweb.android.amityaaroh.LoginActivity;
import android.os.Bundle;
import android.support.design.widget.BottomSheetBehavior;
import android.support.design.widget.BottomSheetDialog;
import android.support.v7.app.AppCompatActivity;
import android.util.TypedValue;
import android.view.View;
import android.widget.Button;
import com.darkweb.android.amityaaroh.R;
public class Events extends AppCompatActivity{
Button button;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.events);
button = (Button)findViewById(R.id.event);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
BottomSheetDialog bottomSheerDialog = new BottomSheetDialog(Events.this);
View parentView = getLayoutInflater().inflate(R.layout.dialog,null);
bottomSheerDialog.setContentView(parentView);
BottomSheetBehavior bottomSheetBehavior = BottomSheetBehavior.from(View)parentView.getParent();
bottomSheetBehavior.setPeekHeight(int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,200,getResources().getDisplayMetrics());
bottomSheerDialog.show();
}
});
}
}
错误代码: 错误:(30,89)错误:';'预期 错误:(31,54)错误:'.class'预计 错误:(31,55)错误:';'预期 错误:执行任务':app:compileDebugJavaWithJavac'失败。Android底部页对话框
Compilation failed; see the compiler error output for details.
线30:BottomSheetBehavior bottomSheetBehavior = BottomSheetBehavior.from(查看)parentView.getParent();
肯定的,但现在新的错误是 错误:(36,58)错误:”的.class'预计 错误:(36, 59)错误:';'预期 行36:bottomSheetBehavior.setPeekHeight (int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,200,getResources()。getDisplayMetrics()); –
@PriyanshMishra请检查更新的答案 –