我正在寻找一种在 android 4.1 及更高版本中使用来自 android L 的圆形按钮的方法,就像"new"google plus 应用程序一样。
是否有任何反向移植库或其他东西(可能具有更多 android l 设计功能)?
我已经看过 google.com/design -> ressources 和 developer.android.com
最佳答案
这只是您想要的示例(我认为)
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.sockettest.MainActivity"
tools:ignore="MergeRootFrame" >
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="250dp"
android:layout_height="100dp"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:background="#ccc"
android:orientation="vertical" >
</LinearLayout>
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toRightOf="@+id/linearLayout1"
android:src="@drawable/ic_launcher"
android:layout_marginLeft="-20dp" />
</RelativeLayout>
您将 imageView
的左侧调整到布局的右侧,然后设置负边距 (-20)。
但要小心,imageView
必须低于您的布局,(您可以将 Layout 与 imageView
交换以查看结果)
关于android - 在 android 4.1 中使用 android L 按钮,例如 google plus app,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24465480/