0
This is the XML of my layout
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".PostScreen">
<android.support.design.widget.FloatingActionButton
android:id="@+id/floatingActionButton"
android:layout_gravity="bottom|end"
android:layout_width="60dp"
android:layout_height="60dp"
android:clickable="true"
android:focusable="true"
app:srcCompat="@color/colorAccent"
android:src="@drawable/add_symbol"
android:onClick="addPost"/>
</android.support.constraint.ConstraintLayout>
Below is the Gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.cliente.postit"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.android.support:design:27.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:design:27.1.1'
Note: The Gravity layout option besides not being suggested has no effect writing manually.
The layout in which the button is inserted may be influencing behavior. Add the full layout.
– Leonardo Lima
I didn’t realize I wasn’t visible
– Paulo Eduardo