小编use*_*985的帖子

无法在scrollview中拖动搜索栏

如果在其他地方已经回答了这个问题我很抱歉 - 我找不到任何关于同样问题的人.

我将SeekBar添加到位于嵌套ScrollView内的RelativeLayout.但是,我无法拖动搜索栏的拇指.我可以沿着它的路径点击来改变它的值,但我无法拖动它.任何帮助,将不胜感激.

我的XML看起来像:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/containerView"
android:background="@android:color/transparent"
android:padding="0dip"
android:layout_margin="0dip"
android:layout_width="fill_parent"
android:layout_height="fill_parent">


<ScrollView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:scrollbarStyle="insideOverlay"
        android:id="@+id/scrollView" android:layout_alignParentTop="true" android:layout_alignParentLeft="true"
        android:fillViewport="true">
    <HorizontalScrollView
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:scrollbarStyle="insideInset"
            android:id="@+id/horizontalScrollView" android:fillViewport="true">
        <RelativeLayout
                android:layout_width="fill_parent"
                android:layout_height="fill_parent" android:id="@+id/scrollContainer">
        </RelativeLayout>
    </HorizontalScrollView>
</ScrollView>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)

我的Java是:

SeekBar thisElement = new SeekBar(getActivity());
thisElement.setEnabled(true);
thisElement.setLayoutParams(lp);
thisElement.setAlpha(alphaVal);
thisElement.setMinimumHeight(elementHeight);
final int min = Integer.parseInt(getJsonPropertyValue(tmpJson, "elementSliderMinimum", "0"));
int max = Integer.parseInt(getJsonPropertyValue(tmpJson, "elementSliderMaximum", "100"));
int def = Integer.parseInt(getJsonPropertyValue(tmpJson, "elementSliderDefault", "50"));
thisElement.setMax(max - min);
thisElement.setProgress(def - min);
thisElement.setTag(elementCounter);
thisElement.setOnTouchListener(new View.OnTouchListener() {
    @Override
    public boolean onTouch(View v, MotionEvent …
Run Code Online (Sandbox Code Playgroud)

android scrollview seekbar

6
推荐指数
2
解决办法
2635
查看次数

如何使用Facebook Pop减慢动画效果?

我正在使用Facebook Pop的弹簧动画在X轴上制作动画.它工作正常,除了我似乎无法改变速度.看来,velocity属性是我读过的唯一方法,但我为它设置的值似乎没有任何效果.我做错了什么,或者这是一个错误?

    POPSpringAnimation *anim = [POPSpringAnimation animationWithPropertyNamed:kPOPLayerPositionX];
    anim.velocity = @(100.);
    anim.springBounciness = 15;
    anim.toValue = @(self.scrollView.frame.size.width/2);
    anim.beginTime = .05 * i + CACurrentMediaTime();
    [thisView.layer pop_addAnimation:anim forKey:@"myKey"];
Run Code Online (Sandbox Code Playgroud)

objective-c ios facebook-pop

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

标签 统计

android ×1

facebook-pop ×1

ios ×1

objective-c ×1

scrollview ×1

seekbar ×1