मैं अपने एफएबी के दाहिनी ओर संरेखित करना चाहता हूं।नीचे संरेखण फ़्लोटिंग एक्शन बटन
- मैं
android:gravity="bottom|right"
- साथ करने की कोशिश की जब मैं
android:layout_alignParentBottom="true
कोशिश "FAB
गायब हो जाता है - जब मैं कोशिश
android:layout_alignBottom="@id/lista_tiendas"
FAB
गायब हो जाता है
यह जटिल लग नहीं करता, लेकिन मैं सिर्फ इसे पूरा नहीं कर सकते
कोई विचार?
<?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:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@+id/lista_tiendas"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:divider="@android:color/transparent"
android:dividerHeight="4.0sp"/>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_add_white_48dp"
app:backgroundTint="@color/spg_rosa"
app:borderWidth="0dp"
app:elevation="8dp"
app:fabSize="normal"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="@id/lista_tiendas"
/>
</RelativeLayout>
हां, मैंने कोड प्रारूप को सही किया है इसलिए सापेक्ष लयआउट दिखाई देता है! टीएक्स –
यह मेरे लिए भी काम करता है, धन्यवाद! एक FAB के लिए LinearLayout क्यों काम नहीं करता है? – Michael
अनुशंसित है: एंड्रॉइड: layout_alignParentEnd = "true" – Zon