【发布时间】:2016-05-17 16:44:19
【问题描述】:
我一直在扯头发;这工作得很好(好吧..几乎,没有正确浮动),然后在我添加android:backgroundTint="@color/fab"后不久它突然停止了,因为最小的SDK是19。
要尝试修复它,我有:
- 更新了 Android Studio / SDK
- 使缓存失效/重启
- 重建项目
- 确认
targetSdkVersion 23 - 确认
compile 'com.android.support:design:23.1.1' - 确认
classpath 'com.android.tools.build:gradle:1.5.0' - 确认
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
快到凌晨 5 点了,如果这很明显,我很抱歉,但我不知道还能尝试什么。 XML:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/com.whereintheworld.com"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ListView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tracking_task_list"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:clickable="true"
android:src="@drawable/fab_ic_add"
android:backgroundTint="@color/fab"
app:layout_anchor="@id/tracking_task_list"
app:layout_anchorGravity="bottom|right|end" />
</android.support.design.widget.CoordinatorLayout>
</RelativeLayout>
【问题讨论】:
标签: xml android-studio gradle floating-action-button