ハッピーニューイヤーです。コードビューでfloatingActionButtonを設定しましたが、デザインビューのボタンは表示されません。ここで問題と思われるものがありますが、これをどのように修正できますか?コードビューでデザインを設定した後に、デザインビューにFloatingActionButtonが表示されない
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
}
<?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"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_height="match_parent"
tools:context=".MainActivity">
<android.support.design.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<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"
app:layout_anchor="@id/viewOne"
app:layout_anchorGravity="bottom|right|end"
app:rippleColor="#FFFFff" />
</android.support.design.widget.CoordinatorLayout>
</RelativeLayout>
'app:layout_anchor =" @ id/viewOne "' –
を削除しても問題はありません。あなたのコードに問題があるとすれば、そのコードを追加する必要があります。 ! –