- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我有这个布局,如果我不在我的 HorizontalScrollView 中使用 fillviewport=true,它会奇怪地缩放(可能是由于不明智的布局嵌套)。
当 fillviewport=false 时一切正常(除了奇怪的缩放),但当 fillviewport=true 时,缩放是完美的但没有滚动发生。
这是布局(注意:我知道你不应该将 webview 放在 scrollview 中。但是 webview 没有 smoothscrollto 也没有公开 setscroller 方法,所以...... bleh。)
<?xml version="1.0" encoding="utf-8"?>
<HorizontalScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/webContainer"
android:layout_below="@+id/titlebar"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true">
<WebView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/webZ"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
</HorizontalScrollView>
设置 android:fillViewport="true"通常不会禁用 View 中的滚动,对吗?
只是应该确保 ScrollView 填满视口(viewport),而不管其内容的大小,嗯?我认为视口(viewport)是屏幕的可见区域,webview 中可见区域边缘肯定有更多内容,我无法再滚动到它了。
我可以从 logcat 中看到正在调用滚动方法,它们只是不改变屏幕。 (除非我将 fillviewport 设置为 false。)
最佳答案
问题是您使用了“fill_parent”,意思是“和我的 parent 一样大”。请改用 wrap_content 作为宽度。
关于android - horizontalscrollview 的 fillviewport 禁用滚动?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5307355/
我有一个简单的布局,顶部有一个名称,还有一个按钮,我希望它位于屏幕底部,或者超出它以防我添加更多项目。 所以我使用 ScrollView 和 LinearLayout 如下:
fillViewPort有什么好处? ? 在 ScrollView , 有时 fillViewPort需要设置为true这样 View 可能会显示出来,而其他时候则根本不需要。 并且文档对它的描述不是
我有这个布局,如果我不在我的 HorizontalScrollView 中使用 fillviewport=true,它会奇怪地缩放(可能是由于不明智的布局嵌套)。 当 fillviewport=f
有没有类似 ScrollView 的东西fillViewPort在 Jetpack 中撰写 Column ? 看这个例子: @Composable fun FillViewPortIssue() {
我正在尝试使用支持库中的新 NestedScrollView。如果可滚动内容较小,我希望扩展以匹配父级。我看到要做到这一点,我应该将 fillViewport=true 添加到 NestedScrol
我是一名优秀的程序员,十分优秀!