【发布时间】:2017-08-14 07:36:39
【问题描述】:
我在 android xml 中遇到问题。我收到上面的错误,但根据我的我没有在我的 xml 中给出循环依赖项。我正在尝试从最后 1 小时开始修复它,但我无法完成它。我根据要求在上面和下面使用过。我在这里附上我的xml。让我知道是否有人可以指出我错在哪里。我的 XML 如下所示
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:fab="http://schemas.android.com/apk/res-auto"
tools:context="com.karopass.karoshare.ImageDetails">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar_imageDetails"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimary"
android:theme="@style/AppTheme.AppBarOverlay"
app:popupTheme="@style/AppTheme.PopupOverlay">
</android.support.v7.widget.Toolbar>
<com.example.utils.ExtendedViewPager
android:id="@+id/view_pager_extended"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/pageNavCount"
android:layout_below="@+id/toolbar_imageDetails"
android:background="@color/image_back"/>
<LinearLayout
android:background="@color/colorPrimary"
android:id="@+id/pageNavCount"
android:orientation="horizontal"
android:layout_above="@+id/devider"
android:layout_width="match_parent"
android:layout_height="20dp">
<RelativeLayout
android:layout_weight="3"
android:id="@+id/new_time_count"
style="@style/SelectableItemBackground"
android:layout_width="0dp"
android:layout_height="match_parent">
<TextView
android:id="@+id/txt_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1 Month ago"
android:textSize="12sp"
android:paddingLeft="5sp"
android:layout_centerVertical="true"
android:textColor="#cccccc"
android:gravity="center|start" />
</RelativeLayout>
<RelativeLayout
android:layout_weight="1"
android:id="@+id/new_share_count"
style="@style/SelectableItemBackground"
android:layout_width="0dp"
android:layout_height="match_parent">
<TextView
android:id="@+id/share_count"
android:layout_centerInParent="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="999"
android:textSize="12sp"
android:paddingLeft="5sp"
android:layout_centerVertical="true"
android:textColor="#cccccc"
android:gravity="center|start" />
</RelativeLayout>
<RelativeLayout
android:layout_weight="1"
style="@style/SelectableItemBackground"
android:id="@+id/new_save_count"
android:layout_width="0dp"
android:layout_height="match_parent">
<TextView
android:id="@+id/like_count"
android:layout_centerInParent="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="999"
android:textSize="12sp"
android:paddingLeft="5sp"
android:layout_centerVertical="true"
android:textColor="#cccccc"
android:gravity="center|start" />
</RelativeLayout>
</LinearLayout>
<View
android:id="@+id/devider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_above="@+id/pageNavLayout"
android:background="#ffffff" />
<LinearLayout
android:background="@color/colorPrimary"
android:id="@+id/pageNavLayout"
android:orientation="horizontal"
android:layout_above="@+id/ll_adLayout_latest"
android:layout_width="match_parent"
android:layout_height="48dp">
<RelativeLayout
android:layout_weight="1"
android:id="@+id/new_time"
style="@style/SelectableItemBackground"
android:clickable="true"
android:layout_width="0dp"
android:layout_height="match_parent">
<ImageView
android:layout_centerInParent="true"
android:scaleType="fitCenter"
android:src="@mipmap/ic_past_961"
android:layout_width="@dimen/nav_but_size"
android:layout_height="@dimen/nav_but_size" />
</RelativeLayout>-->
<TextView
android:background="#ffffff"
android:layout_width="1dp"
android:layout_height="match_parent" />
<RelativeLayout
android:id="@+id/new_copy"
android:clickable="true"
style="@style/SelectableItemBackground"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="match_parent">
<ImageView
android:layout_centerInParent="true"
android:src="@mipmap/ic_copy_96"
android:layout_width="@dimen/nav_but_size"
android:layout_height="@dimen/nav_but_size" />
</RelativeLayout>
<TextView
android:background="#ffffff"
android:layout_width="1dp"
android:layout_height="match_parent" />
<RelativeLayout
android:layout_weight="1"
android:id="@+id/new_save"
style="@style/SelectableItemBackground"
android:clickable="true"
android:layout_width="0dp"
android:layout_height="match_parent">
<ImageView
android:layout_centerInParent="true"
android:src="@mipmap/ic_save_96"
android:layout_width="@dimen/nav_but_size"
android:layout_height="@dimen/nav_but_size" />
</RelativeLayout>
<TextView
android:background="#ffffff"
android:layout_width="1dp"
android:layout_height="match_parent" />
<RelativeLayout
android:layout_weight="1"
android:id="@+id/new_share"
style="@style/SelectableItemBackground"
android:clickable="true"
android:layout_width="0dp"
android:layout_height="match_parent">
<ImageView
android:layout_centerInParent="true"
android:src="@mipmap/ic_share_96"
android:layout_width="@dimen/nav_but_size"
android:layout_height="@dimen/nav_but_size" />
</RelativeLayout>
<TextView
android:background="#ffffff"
android:layout_width="1dp"
android:layout_height="match_parent" />
<RelativeLayout
android:layout_weight="1"
style="@style/SelectableItemBackground"
android:clickable="true"
android:id="@+id/new_fav"
android:layout_width="0dp"
android:layout_height="match_parent">
<ImageView
android:layout_centerInParent="true"
android:src="@mipmap/ic_hearts_96"
android:layout_width="@dimen/nav_but_size"
android:layout_height="@dimen/nav_but_size"/>
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_adLayout_latest"
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical">
</LinearLayout>
</RelativeLayout>
非常感谢:)
【问题讨论】:
标签: java android xml android-layout