标签: scroll

如何在IPython中使用管道

在Linux终端中,当一个命令的输出太长而无法在一个页面中读取时,我可以这样做:

cat file | less
Run Code Online (Sandbox Code Playgroud)

这样我就可以读取并向上和向下滚动cat文件的输出.

我怎么能在IPython中做到这一点?

例如,我试过这个并没有用:

whos | less
Run Code Online (Sandbox Code Playgroud)

我最初的问题是,whos通过Shift + Page Up来看,输出太多了,我不想更改滚动缓冲区.

python scroll ipython pager ipython-magic

16
推荐指数
1
解决办法
6639
查看次数

Android模拟器不会向下滚动

我正在创建一个布局如下,当我在AVD中模拟它时.它不会向下滚动以查看折叠下方的内容.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_height="wrap_content"
    android:layout_width="wrap_content">

    <TextView android:text="@string/UserFormWelcome"
        android:layout_width="fill_parent" android:layout_height="wrap_content"
        android:textSize="20px" android:gravity="center" />

    <TextView android:text="@string/name" android:layout_width="fill_parent"
        android:layout_height="wrap_content" android:textStyle="bold"
        android:paddingTop="20px" android:paddingLeft="10px" />


    <TableLayout android:layout_height="wrap_content"
        android:layout_width="wrap_content">

        <TableRow android:layout_height="wrap_content"
            android:layout_width="match_parent" android:paddingTop="20px">

            <TextView android:text="@string/firstname"
                android:layout_width="fill_parent" android:layout_height="wrap_content"
                android:width="100px" android:paddingLeft="10px" />

            <EditText android:id="@+id/LastName" android:width="200px"
                android:layout_width="fill_parent" android:layout_height="wrap_content" />

        </TableRow>

        <TableRow android:layout_height="wrap_content"
            android:layout_width="match_parent">

            <TextView android:text="@string/lastname"
                android:layout_width="fill_parent" android:layout_height="wrap_content"
                android:paddingLeft="10px" />

            <EditText android:id="@+id/LastName" android:width="200px"
                android:layout_width="fill_parent" android:layout_height="wrap_content" />

        </TableRow>

    </TableLayout>


    <TextView android:text="@string/dob" android:layout_width="wrap_content"
        android:layout_height="wrap_content" android:textStyle="bold"
        android:paddingTop="20px" android:paddingLeft="10px" />

    <TableLayout android:layout_width="fill_parent"
        android:layout_height="wrap_content" android:stretchColumns="3"
        android:paddingTop="20px" android:paddingLeft="10px">
        <TableRow>
            <TextView android:text="@string/date" android:layout_width="wrap_content" …
Run Code Online (Sandbox Code Playgroud)

android scroll tablelayout android-layout android-linearlayout

16
推荐指数
1
解决办法
8480
查看次数

Eclipse:向下滚动文件的最后一行

我一直在寻找无法进行调整的功能,这将使Eclipse的编辑器窗口向下滚动编辑文件最后一行下方的N行.支持此类行为:

  • IntelliJ IDE
  • VIM(例如,通过设置'set scrolloff = 10',可以在最后一行下方滚动10行)
  • 在此先感谢,
    amnong

    eclipse scroll

    16
    推荐指数
    1
    解决办法
    5544
    查看次数

    如何知道UITableView是手动(手动)还是以编程方式滚动?

    我在我的代码中使用UITableView,如果用户手动滚动UITableView或者以编程方式完成,那将会很高兴.有没有办法知道这个?

    scroll uitableview ios

    16
    推荐指数
    3
    解决办法
    6613
    查看次数

    在UIWebView中的contentEditable/designMode时自动滚动

    我正在为我正在处理的iPhone应用程序尝试一个富文本编辑器(具有HTML导出功能),并决定使用iOS 5的WebKit支持contentEditable/ designMode.我已经遇到了一个问题,这个问题正在打破我的需求.在UIWebView中编辑内容时,没有自动滚动跟随光标,例如,在UITextView中.键入时,光标在scrollView下继续,用户必须手动向上滚动.

    这是一些相关的代码:

    - (void)webViewDidFinishLoad:(UIWebView *)webView
    {
        NSString *string = @"document.body.contentEditable=true;document.designMode='on';void(0)";
        [webView stringByEvaluatingJavaScriptFromString:string];
    
        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
    }
    
    Run Code Online (Sandbox Code Playgroud)

    有任何想法如何解决这个问题?我不确定这是否也发生在Safari或仅在UIWebViewWebKit实现中.

    如果您遇到此问题,请务必访问https://bugreport.apple.com并复制rdar:// 16455638.

    scroll designmode contenteditable uiwebview ios

    16
    推荐指数
    2
    解决办法
    9146
    查看次数

    有没有办法防止contentEditable元素在光标到达底部时滚动?

    例如,我有一个contentEditable div,我可以输入它.当文本到达div的底部时,浏览器会自动滚动div,以便文本末尾和光标仍然可见.

    如何防止div滚动以使输入的文本超过div的底部,以便在键入时无法再看到光标?

    我试图实现的行为就像在Photoshop中一样:当你创建一个文本框并输入太多时,光标会继续通过框的底部,你无法看到你正在键入的内容.如果展开框,您将看到所有隐藏文本.

    编辑2012年2月7日上午9:27:这就是我现在所拥有的,但它看起来很奇怪,因为在键盘事件后调整滚动位置:http://jsfiddle.net/trusktr/hgkak/6/所以在此之前keyup事件,光标暂时放入视图中(对于每次击键).我希望没有跳跃,并且当没有视图跳跃时,光标保持在绿色div的末尾以下(跳跃看起来像我的业余黑客:D)

    html javascript html5 scroll contenteditable

    16
    推荐指数
    1
    解决办法
    8218
    查看次数

    检测适配器中的滚动方向(向上/向下)

    我想在我的项目中模仿Google Plus应用程序,因为它现在似乎是参考.

    滚动时的列表视图效果非常好,我想做类似的事情.

    我已经开始使用LayoutAnimationController http://android-er.blogspot.be/2009/10/listview-and-listactivity-layout.html

    LayoutAnimationController controller 
       = AnimationUtils.loadLayoutAnimation(
         this, R.anim.list_layout_controller);
      getListView().setLayoutAnimation(controller);
    
    Run Code Online (Sandbox Code Playgroud)

    这似乎很糟糕,因为并非所有元素都是动画的:

    所以我最后使用了适配器的getView并使用它:

            AnimationSet set = new AnimationSet(true);
    
            Animation animation = new AlphaAnimation(0.0f, 1.0f);
            animation.setDuration(800);
            set.addAnimation(animation);
    
            animation = new TranslateAnimation(
                Animation.RELATIVE_TO_SELF, 0.0f,Animation.RELATIVE_TO_SELF, 0.0f,
                Animation.RELATIVE_TO_SELF, 1.0f,Animation.RELATIVE_TO_SELF, 0.0f
            );
            animation.setDuration(600);
            set.addAnimation(animation);
    
            row.startAnimation(set);
    
    Run Code Online (Sandbox Code Playgroud)

    结果太棒了,我真的很开心!

    不幸的是,它只有在我从列表的顶部滚动到底部时才有效!

    我想在另一边滚动时使它工作,我需要改变一点TranslateAnimation.

    所以我的问题是,有没有办法检测我是否在我的适配器中向上或向下滚动?

    animation android listview scroll direction

    16
    推荐指数
    5
    解决办法
    3万
    查看次数

    平移,准确定义

    滚动和平移有什么区别?平移是否被识别为拖动图像/背景的动作,而滚动仅在您使用滚动条时?

    而且,拖动和平移有什么区别?

    当我拖动谷歌地图的地图,哪个术语是合适的,拖动或平移???

    user-interface scroll terminology drag panning

    16
    推荐指数
    1
    解决办法
    6436
    查看次数

    如果不是body元素,Android无法正确滚动输入焦点

    当移动浏览器调出键盘时,它会尝试移动滚动条,以便输入仍在视图中.

    在iOS Safari上,它似乎通过查找最近的滚动父级来正确执行此操作.

    在Android原生或Chrome移动浏览器上,它似乎只是尝试身体元素然后放弃,因此焦点输入隐藏在键盘下方.

     如何打破它

    设置overflow-y: hidden在body元素上.创建一个可滚动的容器并在其中放置一个表单.

    当您选择靠近屏幕底部的元素时,它将被键盘遮挡.

    演示

    http://dominictobias.com/android-scroll-bug/

    <!DOCTYPE html>
    <html>
    <head>
        <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"/>
        <title>Android scroll/focus bug</title>
        <style>
        html, body {
            margin: 0;
            padding: 0;
            height: 100%;
            overflow: hidden;
        }
        .scroll {
            position: absolute;
            top: 0;
            right: 0;
            bottom: 0;
            left: 0;
            overflow-y: scroll;
        }
        input {
            margin-bottom: 20px;
            width: 100%;
        }
        </style>
    </head>
    <body>
    
        <div class="scroll">
            <input type="text" value="Input 1">
            <input type="text" value="Input 2">
            <input type="text" value="Input 3">
            <input type="text" value="Input 4"> …
    Run Code Online (Sandbox Code Playgroud)

    android scroll google-chrome focus input

    16
    推荐指数
    3
    解决办法
    2万
    查看次数

    BottomSheetDialogFragment 内 LazyColumn 的滚动问题

    我使用LazyColumninside BottomSheetDialogFragment,但如果LazyColumn向上滚动列表,则Bottom工作表对话框将滚动而不是LazyColumn列表。似乎BottomSheetDialogFragment拦截用户触摸输入。

    看起来就是这样:

    LazyColumn里面如何正确使用BottomSheetDialogFragment

    MyBottomSheetDialogFragment.kt:

    class MyBottomSheetDialogFragment : BottomSheetDialogFragment() {
        override fun onCreateView(
            inflater: LayoutInflater,
            container: ViewGroup?,
            savedInstanceState: Bundle?
        ): View {
            return ComposeView(requireContext()).apply {
                setContent {
                    Column(horizontalAlignment = Alignment.CenterHorizontally) {
                        Text("Header", color = Color.Black)
                        LazyColumn(
                            Modifier
                                .weight(1f)
                                .fillMaxWidth()) {
                            items(100) {
                                Text("Item $it", Modifier.fillMaxWidth(), Color.Black)
                            }
                        }
                    }
                }
            }
        }
    }
    
    Run Code Online (Sandbox Code Playgroud)

    并使用以下代码显示它:

    MyBottomSheetDialogFragment().show(activity.supportFragmentManager, null)
    
    Run Code Online (Sandbox Code Playgroud)

    当我们使用 XMLRecyclerView列表时,要解决这个问题,我们必须使用此处描述的方式包装RecyclerView列表,但是如何使用 Jetpack Compose …

    android scroll bottom-sheet android-jetpack-compose lazycolumn

    16
    推荐指数
    2
    解决办法
    7695
    查看次数