有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

一起使用回收器视图和滚动视图时出现java错误?

我一直面临的问题是,在不同选项卡的同一个底部导航活动中同时使用回收器视图和滚动视图。我使用java文件中的可见性隐藏了其中一个视图

我尝试了很多解决方案,但到目前为止都没有成功,所以如果有人能帮我解决这个问题,我将在这里发帖

<安卓.support.constraint.ConstraintLayout xmlns:安卓="http://schemas.安卓.com/apk/res/安卓"
xmlns:app="http://schemas.安卓.com/apk/res-auto"
xmlns:tools="http://schemas.安卓.com/tools"
安卓:id="@+id/container"
安卓:layout_width="match_parent"
安卓:layout_height="match_parent"
tools:context="com.cartoonswikipedia.www.familyconnect.Main2Activity">

<RelativeLayout
    安卓:layout_width="match_parent"
    安卓:layout_height="match_parent">
    <安卓.support.v4.widget.SwipeRefreshLayout
        安卓:id="@+id/swipeRefreshLayout"
        安卓:layout_width="match_parent"
        安卓:layout_height="match_parent"
        安卓:layout_marginTop="60dp"
        安卓:layout_marginBottom="60dp">

        <安卓.support.v7.widget.RecyclerView
            安卓:id="@+id/postrecycler"
            安卓:layout_width="368dp"
            安卓:layout_height="312dp"
            tools:layout_editor_absoluteX="8dp"
            tools:layout_editor_absoluteY="8dp" />

    </安卓.support.v4.widget.SwipeRefreshLayout>

<安卓.support.v7.widget.Toolbar xmlns:安卓="http://schemas.安卓.com/apk/res/安卓"
    安卓:layout_width="match_parent"
    安卓:layout_height="60dp"
    安卓:background="@color/colorPrimaryDark">

    <RelativeLayout
        安卓:layout_width="match_parent"
        安卓:layout_height="match_parent"
        安卓:orientation="horizontal">


        <TextView
            安卓:id="@+id/toolbar_subtitle"
            安卓:layout_width="250dp"
            安卓:layout_height="wrap_content"
            安卓:layout_alignParentLeft="true"
            安卓:layout_alignParentStart="true"
            安卓:layout_centerVertical="true"
            安卓:layout_gravity="left"
            安卓:paddingLeft="10dp"
            安卓:text="@string/app_name"
            安卓:textColor="#FFFFFF"
            安卓:textSize="30dp"
            安卓:textStyle="bold" />

        <ImageView
            安卓:id="@+id/profileimagee45"
            安卓:layout_width="69dp"
            安卓:layout_height="match_parent"
            安卓:layout_alignParentEnd="true"
            安卓:layout_alignParentRight="true"
            安卓:layout_alignParentTop="true"
            安卓:layout_gravity="right"
            安卓:clickable="true"
            安卓:onClick="hi"
            安卓:padding="12dp"
            app:srcCompat="@drawable/c" />
    </RelativeLayout>
</安卓.support.v7.widget.Toolbar>

<ScrollView xmlns:安卓="http://schemas.安卓.com/apk/res/安卓"
    安卓:id="@+id/scrollview"
    安卓:layout_marginTop="60dp"
    安卓:layout_marginBottom="60dp"
    安卓:layout_width="match_parent"
    安卓:layout_height="match_parent"
    安卓:fillViewport="true">

    <TableLayout
        安卓:id="@+id/abc"
        安卓:layout_width="match_parent"
        安卓:layout_height="wrap_content"
        安卓:stretchColumns="1">

        <TextView
            安卓:id="@+id/editemail"
            安卓:layout_width="262dp"
            安卓:layout_height="37dp"
            安卓:textAppearance="@style/TextAppearance.AppCompat.Button"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.113" />

        <ImageView
            安卓:id="@+id/profileimage"
            安卓:layout_width="87dp"
            安卓:layout_height="88dp"
            安卓:adjustViewBounds="false"
            安卓:cropToPadding="false"
            安卓:onClick="proimg"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintHorizontal_bias="0.501"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.167"
            安卓:clickable="false"/>
        <EditText
            安卓:id="@+id/editname"
            安卓:layout_width="262dp"
            安卓:layout_height="50dp"
            安卓:ems="10"
            安卓:hint="Name"
            安卓:inputType="textPersonName"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.338" />
        <LinearLayout
            安卓:id="@+id/abcdef"
            安卓:orientation="vertical">
               <RelativeLayout
                     安卓:layout_width="wrap_content"
                     安卓:layout_height="wrap_content">
            <TextView
                安卓:id="@+id/children"
                安卓:layout_width="match_parent"
                安卓:layout_height="wrap_content"
                安卓:text="Children"
                安卓:textSize="25dp"/>

            <ImageView
                安卓:id="@+id/adddd"
                安卓:layout_width="25dp"
                安卓:layout_height="25dp"
                安卓:layout_alignParentEnd="true"
                 安卓:layout_alignParentRight="true"/>
     </RelativeLayout>
          </LinearLayout>
        <EditText
            安卓:id="@+id/editheight"
            安卓:layout_width="262dp"
            安卓:layout_height="50dp"
            安卓:ems="10"
            安卓:hint="Height in CM"
            安卓:inputType="textPersonName"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.338" />

        <EditText
            安卓:id="@+id/editweight"
            安卓:layout_width="262dp"
            安卓:layout_height="50dp"
            安卓:ems="10"
            安卓:hint="Weight in KG"
            安卓:inputType="textPersonName"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.338" />
        <RelativeLayout>
            <TextView
                安卓:id="@+id/blood"
                安卓:layout_width="wrap_content"
                安卓:layout_height="wrap_content"
                安卓:layout_alignParentLeft="true"
                安卓:layout_alignParentStart="true"
                安卓:layout_centerVertical="true"
                安卓:layout_marginLeft="11dp"
                安卓:layout_marginStart="11dp"
                安卓:text="Blood Group"
                安卓:textSize="25dp" />
        </RelativeLayout>
        <RelativeLayout>
            <TextView
                安卓:id="@+id/religion"
                安卓:layout_width="wrap_content"
                安卓:layout_height="wrap_content"
                安卓:layout_alignParentLeft="true"
                安卓:layout_alignParentStart="true"
                安卓:layout_centerVertical="true"
                安卓:layout_marginLeft="11dp"
                安卓:layout_marginStart="11dp"
                安卓:text="Religion"
                安卓:textSize="25dp" />
        </RelativeLayout>
        <Button
            安卓:id="@+id/editprofile"
            安卓:layout_width="140dp"
            安卓:layout_height="wrap_content"
            安卓:background="#000000"
            安卓:onClick="edit"
            安卓:paddingLeft="10dp"
            安卓:paddingRight="10dp"
            安卓:text="Save Profile"
            安卓:textColor="#ffffff" />
        <Button
            安卓:id="@+id/logout"
            安卓:layout_width="140dp"
            安卓:layout_height="wrap_content"
            安卓:background="#000000"
            安卓:onClick="logout"
            安卓:paddingLeft="10dp"
            安卓:paddingRight="10dp"
            安卓:text="Log Out"
            安卓:textColor="#ffffff"
            安卓:textSize="15dp"
            安卓:textStyle="bold"/>
    </TableLayout>
</ScrollView>

    <ProgressBar
    安卓:id="@+id/empty_progress_bar"
    安卓:layout_width="wrap_content"
    安卓:layout_height="wrap_content"
    安卓:layout_centerInParent="true"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintHorizontal_bias="0.473"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    app:layout_constraintVertical_bias="0.464" />


    <WebView  xmlns:安卓="http://schemas.安卓.com/apk/res/安卓"
        安卓:id="@+id/webview"
        安卓:layout_marginTop="60dp"
        安卓:layout_marginBottom="60dp"
        安卓:layout_width="match_parent"
        安卓:layout_height="match_parent"
        />
</RelativeLayout>
<安卓.support.design.widget.BottomNavigationView
    安卓:id="@+id/navigation"
    安卓:layout_width="0dp"
    安卓:layout_height="wrap_content"
    安卓:layout_marginEnd="0dp"
    安卓:layout_marginStart="0dp"
    安卓:theme="@style/AppTheme"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:menu="@menu/navigation" />


共 (0) 个答案