我正在创建一个应用程序,在底部有三个按钮,我想使用一些标准的Android图标,而不是文本或两者的组合。虽然有 android:drawableStart / top / bottom / etc
命令,但我希望这些图标能够居中显示。似乎没有简单的解决方案?下面是我的工作内容:
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/calm"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".PiktuurMain" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true" >
<Button
android:id="@+id/takepic"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/round" />
<Button
android:id="@+id/editpic"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_weight="1"
android:background="@drawable/round" />
<Button
android:id="@+id/sharepic"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/round"
android:drawableStart="@android:drawable/ic_dialog_email" />
</LinearLayout>
</RelativeLayout>
CTRL+SHIFT+F
进行格式化 ;) - Pratik Butani