小编asi*_*aga的帖子

Scrollview无法在Android底片中滚动

BottomSheet在android支持中尝试了新功能.在里面BottomSheet我放了一个TextView和一个ScrollView.该BottomSheet表现得很好,我发现的唯一的问题是,ScrollViewBottomSheet没有滚动.每次我尝试滚动时,滚动的主要活动中的布局或BottomSheet从折叠到展开的更改状态.

这是我的Activity类代码的片段:

private BottomSheetBehavior behavior;
View bottomSheet;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    setTextViewOnClickListener(this, findViewById(R.id.parentLayout));

    CoordinatorLayout coordinatorLayout = (CoordinatorLayout) findViewById(R.id.main_content);

    // The View with the BottomSheetBehavior
    bottomSheet = coordinatorLayout.findViewById(R.id.bottom_sheet);
    behavior = BottomSheetBehavior.from(bottomSheet);
    behavior.setBottomSheetCallback(new BottomSheetBehavior.BottomSheetCallback() {
        @Override
        public void onStateChanged(@NonNull View bottomSheet, int newState) {
            // React to state change

        }


        @Override
        public void onSlide(@NonNull View bottomSheet, float slideOffset) {
            // React to …
Run Code Online (Sandbox Code Playgroud)

android android-layout bottom-sheet

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

标签 统计

android ×1

android-layout ×1

bottom-sheet ×1