标签: android-scrollview

滚动视图中的Android 5.0 Datepicker无法正常工作(不滚动月份)

我在片段中实现了新的datepicker.这包含在scrollview中.当我尝试使用日期选择器时,我必须先点击并按住屏幕上的某个位置,然后才能滚动日期选择器calader,让我们说可能.

有没有办法来解决这个问题?

即时通讯使用此时间戳: 在此输入图像描述

我加载它像这样:

 <ScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/scrollView2"
    android:layout_row="11"
    android:fillViewport="true"
    android:background="#162229"
    android:layout_column="2"
    android:paddingBottom="20dp">
<LinearLayout
    android:id="@+id/linearLayout1"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:gravity="center"
    android:background="#162229"

    android:orientation="vertical" >

    <DatePicker
        android:id="@+id/datePicker1"
        android:layout_width="wrap_content"
        android:background="#162229"
        android:calendarTextColor="#fff"
        android:layout_height="wrap_content"

        android:calendarViewShown="false" > <!-- style="@style/date_picker_style" -->
    </DatePicker>
</LinearLayout>
</ScrollView>
Run Code Online (Sandbox Code Playgroud)

android datepicker android-scrollview

11
推荐指数
2
解决办法
5089
查看次数

在android下面的工具栏下面的Scrollview

是否可以在Android下的工具栏下设置滚动条?我正在尝试滚动条视图我有工具栏附加到我的布局像这样:

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/layoutcolor_background"
        android:orientation="vertical"
        tools:ignore="ContentDescription,RtlHardcoded,NestedWeights">

        <include
            android:id="@+id/toolbar"
            layout="@layout/main_toolbar" />

        <View
            android:layout_width="match_parent"
            android:layout_height="5dp"
            android:background="@drawable/toolbar_dropshadow" />

        <LinearLayout
            android:id="@+id/aandcID"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="2dp"
            android:layout_marginRight="2dp"
            android:layout_weight=".50"
            android:baselineAligned="false"
            android:orientation="horizontal">

            <RelativeLayout
                android:id="@+id/alayout"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_margin="1dp"
                android:layout_weight=".50"
                android:background="@color/layoutbackgroudforrow"
                android:gravity="center">

                <ImageView
                    android:id="@+id/aimage"
                    android:layout_width="100dp"
                    android:layout_height="100dp"
                    android:layout_centerHorizontal="true"
                    android:paddingBottom="3dp"
                    android:paddingTop="5dp"
                    android:src="@drawable/acc" />

                <TextView
                    android:id="@+id/aType"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_below="@+id/aimage"
                    android:layout_centerHorizontal="true"
                    android:layout_marginTop="5dp"
                    android:ellipsize="end"
                    android:gravity="center"
                    android:paddingLeft="2dp"
                    android:singleLine="true"
                    android:text="Deposit"
                    android:textColor="@color/blackText"
                    android:textSize="18sp"
                    android:textStyle="bold"
                    tools:ignore="RtlSymmetry,RtlHardcoded,HardcodedText" />

                <TextView
                    android:id="@+id/anumber"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_below="@+id/aType"
                    android:layout_centerHorizontal="true"
                    android:layout_marginTop="5dp"
                    android:ellipsize="end"
                    android:gravity="center"
                    android:paddingLeft="2dp"
                    android:singleLine="true"
                    android:text="12345678901234567890"
                    android:textColor="@color/blackText" …
Run Code Online (Sandbox Code Playgroud)

android android-scrollview

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

动态无尽RecyclerView滚动问题

我必须创建以下布局 在此输入图像描述

到目前为止,我已经成功创建了布局并填充了所有视图.但是,我在第一个片段制作ReyclerView Endless时遇到了问题.

考虑到RecyclerView在首次加载时有10个项目,现在滚动我正在添加另外10个项目,依此类推.然而,RecyclerView没有显示那些项目,它的高度在第10个元素的末尾得到修复.我知道元素在RecyclerView中正确加载,如果我尝试用两个手指在模拟器(GenyMotion)上滚动,RecyclerView滚动就好了.

更新: -

RecyclerView的片段代码 -

public class CheckInFragmentRecyclerAdapter extends RecyclerView.Adapter<CheckInFragmentRecyclerAdapter.ViewHolder> {
    final List<StoreNew> stores;

    public CheckInFragmentRecyclerAdapter(final List<StoreNew> stores) {
        this.stores = stores;
    }

    @Override
    public CheckInFragmentRecyclerAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        final View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.child_check_in_fragment, parent, false);
        return new ViewHolder(view);
    }

    @Override
    public void onBindViewHolder(CheckInFragmentRecyclerAdapter.ViewHolder holder, int position) {
        // Setting data
    }


    @Override
    public int getItemCount() {
        return stores.size();
    }

    /**
     * Function to clear existing data from list
     * @param stores StoreNew instance containing …
Run Code Online (Sandbox Code Playgroud)

android android-scrollview endlessscroll android-recyclerview

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

Recyclerview 不在 Nested ScrollView 内滚动

Recyclerview这是在Coordinatorlayout> NestedScrollview>ViewPagerViewPager有3个片段,一个具有正与帮助图片库Recyclerview。每当我尝试向上或向下滚动时,它根本不滚动。我已经设置好了photosRecycler.setNestedScrollingEnabled(false);,一旦我删除这条线,我就会让滚动只向下工作,当我试图向上移动时,它会随着父级向上移动Nestedscrollview

我的布局管理器也将 StaggeredGrid 显示为 Grid 我需要获得这种布局

在此处输入图片说明

这是我的 Nestedscrollview 父布局

<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout 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:background="?android:attr/colorBackground"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <com.google.android.material.appbar.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >

        <com.google.android.material.appbar.CollapsingToolbarLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:fitsSystemWindows="true"
            app:expandedTitleMarginStart="48dp"
            app:expandedTitleMarginEnd="64dp"
            app:contentScrim="?attr/colorPrimary"
            app:layout_scrollFlags="scroll|enterAlways">

            <androidx.constraintlayout.widget.ConstraintLayout


                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="?android:colorBackground">


                <ImageView

                    android:layout_width="match_parent"
                    android:layout_height="500dp"
                    android:src="@color/custom_transparent_colorBlack"
                    android:scaleType="centerCrop"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintHorizontal_bias="0.0"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent"
                    />

                <de.hdodenhof.circleimageview.CircleImageView

                    android:layout_width="128dp"
                    android:layout_height="128dp"
                    app:layout_constraintBottom_toBottomOf="@+id/coverPhoto"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="@+id/coverPhoto"
                    app:layout_constraintVertical_bias="0.44"
                    tools:srcCompat="@tools:sample/avatars" />



            </androidx.constraintlayout.widget.ConstraintLayout>
        </com.google.android.material.appbar.CollapsingToolbarLayout>
    </com.google.android.material.appbar.AppBarLayout>
    <androidx.core.widget.NestedScrollView
        android:id="@+id/up_NestedScrollView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:overScrollMode="never"
        app:layout_behavior="@string/appbar_scrolling_view_behavior" …
Run Code Online (Sandbox Code Playgroud)

java android android-scrollview android-gridlayout android-recyclerview

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

当项目非常有限时,在scrollview中有什么更好,listview或linearlayout?

我将有一个屏幕,其中将有11个图像一个在另一个之下,因此列表每行只有一个图像.现在,我对使用自定义适配器的listview或scrollview包含的linearlayout感到困惑?什么会更好?

android android-listview android-linearlayout android-scrollview

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

如何在Android中选择微调器时停止滚动屏幕到顶部

我在滚动视图中使用微调器,当我选择微调器时,滚动视图滚动到屏幕顶部.有没有办法阻止这个卷轴?

任何帮助表示赞赏.

谢谢.

android scroll android-scrollview android-spinner

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

修复Scrollview中的Mediacontroller位置

我的android活动中有一个媒体控制器,它使用setAnchorView来设置初始位置.从我所读到的媒体控制器处于滚动视图中,媒体控制器的窗口只是跟随滚动,这显然不是我想要的.

是否有一些方法以编程方式修复媒体控制器的位置,使其不遵循滚动视图?

非常感谢.

android mediacontroller android-scrollview android-activity

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

如何创建一个水平滚动列表,其中包含对中心的捕捉效果

好!过去几周我一直试图这样做,似乎无法找到一个很好的解决方案来实现我想要的.一直在尝试使用Horizo​​ntalScrollView,Gallery(不推荐使用).

我现在正在研究RecycleView,因为我遇到了这个方法.smoothScrollToPosition(),并认为这可能对我有帮助.

以下是我想要完成的事情的说明:

在此输入图像描述

我还必须能够以编程方式创建相对布局

任何人都可以向我指出如何实现这一目标吗?有没有本土的方法呢?

编辑:在进一步了解@CommonsWare关于调查ViewPager的建议和来自Dave Smith的commonsware.com/blog/2012/08/20/第三篇文章后,我认为这是要走的路.还没有将它改为我的使用,但看起来不错.

我正在使用他的Github中的Dave Smiths样本:https://gist.github.com/devunwired/8cbe094bb7a783e37ad1

android horizontalscrollview android-scrollview swipe-gesture android-relativelayout

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

使用View Pager进行循环滚动

我们需要通过滑动图像协调旋转轮.我已经使用了ViewPager但是在360度旋转之后

我必须从X = 0开始滚动ViewPager.是否有任何ViewPager在滚动到最后位置后从第一页开始?

我使用setScrollX来滚动ViewPager,它也会在旋转动画中引入毛刺.我想要实现像下面的图像.

这是示例应用程序的链接,只是我想要实现的最小化实现.

在此输入图像描述

android infinite-scroll android-scrollview android-viewpager android-scrolling

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

停止滚动父级 (NestedScrollview) 滚动子级 (RecyclerView) 时

我需要类似于此实现的行为但 NestedScrollView 将是父级, RecyclerView 将是 NestedScrollView 的子级。

例如:https : //medium.com/widgetlabs-engineering/scrollable-nestedscrollviews-inside-recyclerview-ca65050d828a

我不确定它是否可以实现。尝试在 child(RV) 滚动时禁用 parent(NSV),但是在 child 上滚动会滚动整个视图,包括 parent。

android android-scrollview android-recyclerview android-nestedscrollview

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