在Linux终端中,当一个命令的输出太长而无法在一个页面中读取时,我可以这样做:
cat file | less
Run Code Online (Sandbox Code Playgroud)
这样我就可以读取并向上和向下滚动cat文件的输出.
我怎么能在IPython中做到这一点?
例如,我试过这个并没有用:
whos | less
Run Code Online (Sandbox Code Playgroud)
我最初的问题是,whos通过Shift + Page Up来看,输出太多了,我不想更改滚动缓冲区.
我正在创建一个布局如下,当我在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
我一直在寻找无法进行调整的功能,这将使Eclipse的编辑器窗口向下滚动编辑文件最后一行下方的N行.支持此类行为:
在此先感谢,
amnong
我在我的代码中使用UITableView,如果用户手动滚动UITableView或者以编程方式完成,那将会很高兴.有没有办法知道这个?
我正在为我正在处理的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.
例如,我有一个contentEditable div,我可以输入它.当文本到达div的底部时,浏览器会自动滚动div,以便文本末尾和光标仍然可见.
如何防止div滚动以使输入的文本超过div的底部,以便在键入时无法再看到光标?
我试图实现的行为就像在Photoshop中一样:当你创建一个文本框并输入太多时,光标会继续通过框的底部,你无法看到你正在键入的内容.如果展开框,您将看到所有隐藏文本.
编辑2012年2月7日上午9:27:这就是我现在所拥有的,但它看起来很奇怪,因为在键盘事件后调整滚动位置:http://jsfiddle.net/trusktr/hgkak/6/所以在此之前keyup事件,光标暂时放入视图中(对于每次击键).我希望没有跳跃,并且当没有视图跳跃时,光标保持在绿色div的末尾以下(跳跃看起来像我的业余黑客:D)
我想在我的项目中模仿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.
所以我的问题是,有没有办法检测我是否在我的适配器中向上或向下滚动?
滚动和平移有什么区别?平移是否被识别为拖动图像/背景的动作,而滚动仅在您使用滚动条时?
而且,拖动和平移有什么区别?
当我拖动谷歌地图的地图,哪个术语是合适的,拖动或平移???
当移动浏览器调出键盘时,它会尝试移动滚动条,以便输入仍在视图中.
在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) 我使用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
scroll ×10
android ×4
ios ×2
animation ×1
bottom-sheet ×1
designmode ×1
direction ×1
drag ×1
eclipse ×1
focus ×1
html ×1
html5 ×1
input ×1
ipython ×1
javascript ×1
lazycolumn ×1
listview ×1
pager ×1
panning ×1
python ×1
tablelayout ×1
terminology ×1
uitableview ×1
uiwebview ×1