Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/184.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 弯曲的滚动条和方框插图_Android_Scrollbar_Wear Os - Fatal编程技术网

Android 弯曲的滚动条和方框插图

Android 弯曲的滚动条和方框插图,android,scrollbar,wear-os,Android,Scrollbar,Wear Os,我创建了一个确认活动,以获得用户对继续操作的批准。我使用未弃用的android.support.wear.widget.BoxInsetLayout创建了活动 不幸的是,描述变得比屏幕显示的时间长,按钮被切断,无法向下滚动。我尝试添加一个ScrollView和一些scrollbar属性,但无法使其工作 查看android wear系统中的一些确认活动,确实可以获得带有曲线滚动条的BoxInsetLayout 如何使BoxInsetLayout在曲线模式下可滚动? 我是否必须堆叠一个可穿戴的回收视

我创建了一个确认活动,以获得用户对继续操作的批准。我使用未弃用的android.support.wear.widget.BoxInsetLayout创建了活动

不幸的是,描述变得比屏幕显示的时间长,按钮被切断,无法向下滚动。我尝试添加一个ScrollView和一些scrollbar属性,但无法使其工作

查看android wear系统中的一些确认活动,确实可以获得带有曲线滚动条的BoxInsetLayout

如何使BoxInsetLayout在曲线模式下可滚动? 我是否必须堆叠一个可穿戴的回收视图和一个盒子插页

期待你的回答。提前谢谢

图片:

活动布局xml:


我为我的问题找到了一个合适的解决方案:我废弃了BoxInsetLayout。 这似乎只是不可能得到这个布局滚动

作为替代,我只是使用带有线性布局的滚动视图作为子视图。ScrollView本身支持弯曲的滚动条,为了支持圆形屏幕,我自己计算了插图,并将其作为线性布局的填充

我写了一篇关于这个具体问题和解决方案的博客:

此外,我用该解决方案制作了一个片段,并将其上传到Bitbucket:


我为我的问题找到了一个合适的解决方案:我废弃了BoxInsetLayout。 这似乎只是不可能得到这个布局滚动

作为替代,我只是使用带有线性布局的滚动视图作为子视图。ScrollView本身支持弯曲的滚动条,为了支持圆形屏幕,我自己计算了插图,并将其作为线性布局的填充

我写了一篇关于这个具体问题和解决方案的博客:

此外,我用该解决方案制作了一个片段,并将其上传到Bitbucket:


您如何知道屏幕截图中的系统对话框正在使用BoxInsetLayout?可能只是一个滚动视图,在值舍入中定义了边距/填充,或者其他一些实现方法。您还尝试了什么?这里已经给出了答案:您如何知道屏幕截图中的系统对话框正在使用BoxInsetLayout?可能只是一个滚动视图,在值舍入中定义了边距/填充,或者其他一些实现方法。你还试过什么?这里已经给出了答案:有点不舒服的BoxInset仅限于BoxedGes的边界:喜欢你的解决方案,谢谢你,伙计。这真是太有用了。有点像是一个蹩脚的盒子插图,只限于盒子的边界。谢谢你,伙计。这非常有用。
<?xml version="1.0" encoding="utf-8"?>
<android.support.wear.widget.BoxInsetLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/dark_grey">

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="center"
    android:orientation="vertical"
    app:boxedEdges="all">

    <TextView
        android:id="@+id/text_description"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="4dp"
        android:fontFamily="sans-serif-condensed"
        android:gravity="bottom|center"
        android:text=""
        android:textSize="14sp" />

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="4dp"
        android:layout_marginTop="4dp"
        android:fontFamily="sans-serif-condensed"
        android:gravity="bottom|center"
        android:text="@string/warning_question_colorful_ambient"
        android:textSize="16sp" />

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="4dp"
        android:layout_marginTop="4dp">

        <android.support.wearable.view.CircledImageView
            android:id="@+id/button_cancel"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="start|end"
            android:src="@drawable/ic_close_24dp"
            app:circle_color="#AFAFAF"
            app:circle_radius="25dp"
            app:circle_radius_pressed="20dp" />

        <android.support.wearable.view.CircledImageView
            android:id="@+id/button_ok"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="end|bottom"
            android:src="@drawable/ic_check_24dp"
            app:circle_color="#0EB695"
            app:circle_radius="25dp"
            app:circle_radius_pressed="20dp" />
    </FrameLayout>
</LinearLayout>

</android.support.wear.widget.BoxInsetLayout>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:id="@+id/layout_content"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
        [..]
    </LinearLayout>
override fun onCreate(savedInstanceState: Bundle?) {
    [..]
    adjustInset()
}

private fun adjustInset() {
    if (applicationContext.resources.configuration.isScreenRound) {
        val inset = (FACTOR * displayMetrics.widthPixels).toInt()
        layout_content.setPadding(inset, inset, inset, inset)
    }
}

companion object {
    private const val FACTOR = 0.146467f // c = a * sqrt(2)
}