Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/17.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_Android Progressbar_Android Relativelayout - Fatal编程技术网

Android 调整调整大小,使进度条向右移动

Android 调整调整大小,使进度条向右移动,android,android-progressbar,android-relativelayout,Android,Android Progressbar,Android Relativelayout,我有一个进度条在一个相对的窗口内。在我显示软键盘和进度条向右移动之前,一切正常 这将修复移位进度条,但会导致videoview移位 当我在视频视图中添加android:layout\u centerInParent=“true”时,它会起作用 <VideoView android:id="@+id/fragment_video_video_view" android:layout_width="match_parent"

我有一个进度条在一个相对的窗口内。在我显示软键盘和进度条向右移动之前,一切正常

这将修复移位进度条,但会导致videoview移位


当我在视频视图中添加
android:layout\u centerInParent=“true”
时,它会起作用

<VideoView
            android:id="@+id/fragment_video_video_view"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_centerInParent="true" />


尝试更改ProgressBar
android:layout\u width=“match\u parent”
最终将我的整个视频视图向左移动,但它会阻止ProgressBar移动。您可以发送完整的xml布局吗?可能其他因素会影响显示,比如当你的相对版面高度为0dp
android:layout\u height=“0dp”
时,你是如何显示版面的?也许我这里遗漏了什么?当然,我在上面的编辑中添加了版面。lol你只需要添加
android:layout\u centerInParent=“true”
在VideoView中。哈哈,我没有想到这一点,因为在我更改progressbar xD之前,它在没有它的情况下也能正常工作。谢谢大家,非常感谢
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:background="@color/blackBackground">


    <RelativeLayout
        android:id="@+id/fragment_video_video_layout"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        app:layout_constraintHeight_percent=".33"
        app:layout_constraintWidth_default="percent"
        app:layout_constraintTop_toTopOf="parent"
        android:gravity="center">

        <VideoView
            android:id="@+id/fragment_video_video_view"
            android:layout_width="match_parent"
            android:layout_height="match_parent"/>

        <ProgressBar
            android:id="@+id/video_progress_bar"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"/>

    </RelativeLayout>




    <TextView
        android:id="@+id/fragment_video_textview_chat"
        android:layout_width="match_parent"
        android:layout_height="48dp"
        android:gravity="center_vertical"
        android:text="Chat"
        android:textColor="@color/colorBlack"
        app:layout_constraintTop_toBottomOf="@+id/fragment_video_video_layout"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        android:background="@color/whiteText"
        android:paddingLeft="12dp"/>


    <RelativeLayout
        android:id="@+id/fragment_video_sendmessage_layout"
        android:layout_width="match_parent"
        android:layout_height="49dp"
        android:layout_alignParentBottom="true"
        android:background="@color/whiteText"
        app:layout_constraintBottom_toBottomOf="parent">

        <View
            android:id="@+id/fragment_video_video_divider1"
            android:layout_width="match_parent"
            android:layout_height="0.5dp"
            android:background="@color/dividerColor"/>

        <EditText
            android:id="@+id/fragment_video_sendmessage_edittext"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:hint="Say something in chat"
            android:textSize="14sp"
            android:paddingLeft="12dp"
            android:background="@null"
            android:layout_toLeftOf="@+id/fragment_video_sendmessage_button"
            android:inputType="text"
            android:maxLines="1"
            android:layout_below="@+id/fragment_video_video_divider1"/>

        <Button
            android:id="@+id/fragment_video_sendmessage_button"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_alignParentEnd="true"
            android:text="Send"
            android:background="@null"
            android:textAllCaps="false"
            android:minHeight="0dp"
            android:minWidth="0dp"
            android:padding="10dp"
            android:layout_below="@+id/fragment_video_video_divider1"/>

    </RelativeLayout>

    <android.support.v7.widget.RecyclerView
        android:id="@+id/fragment_video_recycler"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        app:layout_constraintTop_toBottomOf="@+id/fragment_video_textview_chat"
        app:layout_constraintBottom_toTopOf="@id/fragment_video_sendmessage_layout"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        android:background="@color/whiteText">
    </android.support.v7.widget.RecyclerView>

</android.support.constraint.ConstraintLayout>
android:layout_width="match_parent"
<VideoView
            android:id="@+id/fragment_video_video_view"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_centerInParent="true" />