Android eclipse中的浮动操作按钮,单击时将导航到另一个活动 [英] Floating Action Button in android eclipse which on clicking will navigate to another activity
本文介绍了Android eclipse中的浮动操作按钮,单击时将导航到另一个活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要在android eclipse中实现一个浮动操作按钮,点击后将导航到另一个活动。我不想在Android Studio中。
I need to implement a floating action button in android eclipse which on clicking will navigate to another activity . I don't want it in Android Studio.
推荐答案
您可以使用官方android设计库创建FAB。
http://developer.android.com/tools/ support-library / features.html#design
You can use official android design library to create FAB . http://developer.android.com/tools/support-library/features.html#design
<android.support.design.widget.CoordinatorLayout
android:id="@+id/coordinatorLayout"
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=".MainActivity">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical"/>
</RelativeLayout>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="15dp"
android:layout_marginRight="15dp"
android:src="@mipmap/image"
app:fabSize="normal"
app:layout_anchor="@id/coordinatorLayout"
app:layout_anchorGravity="bottom|right|end"
app:rippleColor="#F03333"/>
在eclipse中添加设计库:
在Eclipse中使用支持设计库
Check this answer on how to add design library in eclipse : Using Support Design Library in Eclipse
这篇关于Android eclipse中的浮动操作按钮,单击时将导航到另一个活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文