scrollview

Android 开发:ScrollView嵌套RecycleView 冲突+监听ScrollView滑动位置

你说的曾经没有我的故事 提交于 2020-02-27 18:43:38
重写ScrollView 注释附参考路径 import android.content.Context; import android.util.AttributeSet; import android.util.Log; import android.view.View; import android.widget.ScrollView; /** * ScrollView 监听 * https://www.cnblogs.com/Jieth/p/9192611.html */ public class ReadScrollView extends ScrollView { public ReadScrollView(Context context) { super(context); } public ReadScrollView(Context context, AttributeSet attrs) { super(context, attrs); } public ReadScrollView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } /** * * @param scrollX * @param scrollY *

How to zoom particular part of UIScrollView?

荒凉一梦 提交于 2020-02-24 12:16:27
问题 HI, I develop an application in which I want to implement the splash screen, on that splash screen I want to bind the scrollView and UIImage. My code as follow, -(void)splashAnimation{ window = [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, 320, 420)]; //scrollView = [[UIScrollView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]]; scrollView = [[UIScrollView alloc] initWithFrame:[window bounds]]; scrollView.pagingEnabled = NO; scrollView.bounces = NO; UIImage *image = [UIImage

Android:ScrollView和SwipeRefreshLayout高度测量

偶尔善良 提交于 2020-02-24 12:00:14
今天组里的同事要做一个奇葩的效果,要求在ScrollView里嵌套一个RefreshLayout。类似代码如下: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> //红色背景 <ScrollView android:layout_width="match_parent" android:layout_height="match_parent" android:background="#ff00ff"> //黄色背景 <android.support.v4.widget.SwipeRefreshLayout android:layout_width="match_parent" android:layout_height="fill_parent" android:background="#ffff00"> //黑色背景 <LinearLayout android:layout_width="match

ScrollView Inside ViewPager Not Working

独自空忆成欢 提交于 2020-02-20 11:42:10
问题 i have an activity ViewPager and which have Tabbed Childs. The childs with recycler View do Scroll. Although When i create a simple fragment with scroll view it does not work. here is the main activity fragment - <?xml version="1.0" encoding="utf-8"?> <android.support.design.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:layout_width="match_parent"

iOS translucent automaticallyAdjustsScrollViewInsets edgesForExtendedLayout contentInsetAdjustmentBehavior

青春壹個敷衍的年華 提交于 2020-02-17 17:00:14
translucent self.navigationController.navigationBar.translucent = NO; ios7 之后iOS7之后由于navigationBar.translucent默认是YES, 原点在(0,0)点 当设置NO的时候,原点坐标在(0,64)点开始,屏幕会多一个导航栏的高度 automaticallyAdjustsScrollViewInsets self.automaticallyAdjustsScrollViewInsets = NO; self.edgesForExtendedLayout = UIRectEdgeNone; contentInsetAdjustmentBehavior iOS11中automaticallyAdjustsScrollViewInsets方法被废弃,我们需要使用UIScrollView的 contentInsetAdjustmentBehavior 属性来替代它. 我们先来看看contentInsetAdjustmentBehavior这个枚举值: typedef NS_ENUM(NSInteger, UIScrollViewContentInsetAdjustmentBehavior) { UIScrollViewContentInsetAdjustmentAutomatic,

Android的ScrollView简单使用实例

房东的猫 提交于 2020-02-11 01:51:54
垂直滚动:Scroll 水平滚动:HorizontalScrollView ScrollView称为滚动视图,是当在一个屏幕的像素显示不下的时候,可以采用滑动的方式,显示在UI上 注意:ScrollView的子元素只能有一个。 直接上布局文件: < ScrollView xmlns : android = "http://schemas.android.com/apk/res/android" xmlns : tools = "http://schemas.android.com/tools" tools : context = ".MainActivity" android : layout_width = "match_parent" android : layout_height = "match_parent" android : padding = "10dp" > < LinearLayout android : layout_width = "match_parent" android : layout_height = "match_parent" android : orientation = "vertical" > < Button android : id = "@+id/IVButton_Id" android : layout_width =

Programmatically scrolling a word into view in a textview

北城以北 提交于 2020-02-10 03:17:48
问题 I have TextView with a large amount of text, the user searches for something and I highlight the matches, however they may be way down the page, is there a way to scroll to the first match? I looked all over google and did not seem to find anything relevant. My Layout : <ScrollView android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:requiresFadingEdge="vertical" android:id="@+id/sclView"> <TextView android:layout_width="match_parent" android

Programmatically scrolling a word into view in a textview

大憨熊 提交于 2020-02-10 03:17:09
问题 I have TextView with a large amount of text, the user searches for something and I highlight the matches, however they may be way down the page, is there a way to scroll to the first match? I looked all over google and did not seem to find anything relevant. My Layout : <ScrollView android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:requiresFadingEdge="vertical" android:id="@+id/sclView"> <TextView android:layout_width="match_parent" android

Android -- 自定义ScrollView实现放大回弹效果

故事扮演 提交于 2020-02-08 22:28:00
1, 刚刚在别人开源的项目中看到了一个挺不错的用户体验,效果图如下: 2, 那下面我们就来实现一下,首先看一下布局,由于一般只是我们包含头像的那部分方法,所以这里我们要把布局分成两部分,对应的布局文件效果图如下: 3, 自定义ScrollView   第一步:创建一个类,继承自ScrollView,重写相应的构造函数 public class ZoomInScrollView extends ScrollView { public ZoomInScrollView(Context context) { this(context, null); } public ZoomInScrollView(Context context, AttributeSet attrs) { this(context, attrs, 0); } public ZoomInScrollView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } }    第二步:重写OnFinishInflate()方法,并记录第一个子view,即我们的head_fragment @Override protected void onFinishInflate() { super

Scrollview not working when it has viewpager in android

人走茶凉 提交于 2020-02-06 09:07:07
问题 In my activity we have view pager which shows tabs and other views at top. ViewPager tabs shows different Fragments. Below is the code activity_main.xml <?xml version="1.0" encoding="utf-8"?> <androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/root" android:layout_width="match_parent" android:layout_height="match_parent" android:fillViewport="true"> <LinearLayout android:layout