【发布时间】:2016-03-08 06:27:51
【问题描述】:
最近我使用 Android 支持库版本 23.2.0 更新了我的应用程序,我发现这个库中存在一个错误,导致应用程序在为片段充气时崩溃。
这是从 GoogleAnalytics 看到的错误。到目前为止,我在 Android 6.0、2.3.6 和 4.4.4 中找到了它: IllegalStateException (@CoordinatorLayout$LayoutParams:resolveAnchorView:2522) {main}
这似乎是支持库中的一个错误(它似乎也会影响其他组件)。我已经解决了它返回到版本 23.1.1 并且我的应用程序运行良好。我还没有找到崩溃的原因,但这里是导致它的片段。也许你可以看到其他东西。
非常感谢!
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/linear_lines"
android:layout_height="match_parent"
android:layout_width="match_parent"
>
<android.support.design.widget.CoordinatorLayout
android:id="@+id/coordinator_lines"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:layout_above="@+id/relative_date_text"
>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.TabLayout
android:id="@+id/sliding_tabs"
style="@style/MyCustomTabLayout"
android:layout_width="match_parent"
android:layout_height="@dimen/abc_action_button_min_height_material"
android:background="@color/blue_soriabus"
android:elevation="10dp"
/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<android.support.v4.view.ViewPager
android:id="@+id/vpPager"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
<View
android:id="@+id/shadow_view"
android:layout_width="match_parent"
android:layout_height="7dp"
android:background="@drawable/toolbar_shadow" />
</RelativeLayout>
</LinearLayout>
<android.support.design.widget.FloatingActionButton
android:id="@+id/floating_button_open_map"
app:borderWidth="0dp"
app:backgroundTint="@color/blue_soriabus"
app:elevation="10dp"
android:src="@drawable/ic_map_white_48dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|right|end"
android:layout_marginRight="16dp"
android:layout_marginBottom="16dp"
android:layout_alignParentBottom="true"
app:layout_anchor="@id/coordinator_lines"
app:layout_anchorGravity="bottom|right|end"
/>
<android.support.design.widget.FloatingActionButton
android:id="@+id/floating_button_open_calendar"
app:borderWidth="0dp"
app:backgroundTint="@color/blue_soriabus"
app:elevation="10dp"
android:src="@drawable/ic_calendar_white_36dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="90dp"
app:layout_anchor="@id/floating_button_open_map"
app:layout_anchorGravity="top"
android:layout_gravity="top|right|end"
/>
</android.support.design.widget.CoordinatorLayout>
<RelativeLayout
android:id="@+id/relative_date_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="10dp"
android:background="@color/blue_soriabus_dark"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
>
<TextView
android:id="@+id/date_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/pure_white"
android:layout_centerInParent="true"
android:text="Fecha"
/>
</RelativeLayout>
</RelativeLayout>
【问题讨论】:
标签: android android-support-library