我正在创建一个
Android应用程序,我有一个按钮,后面有自定义背景图片.背景图像只是一个矩形,但现在按钮文本似乎没有垂直居中.这是我的按钮xml:
android:id="@+id/save_to_list"
android:layout_below="@+id/info_pic"
android:text="SAVE TO LIST"
android:textColor="@android:color/white"
android:layout_centerHorizontal="true"
android:layout_gravity="center_horizontal"
android:layout_width="260dp"
android:layout_height="35dp"
android:layout_marginTop="15dp"
android:layout_marginBottom="15dp">
我在这里设置背景:
ImageView button_bg = (ImageView)findViewById(R.id.button_background);
savetolist_button.setBackgroundDrawable(button_bg.getDrawable());
是否有更改按钮内文本位置的位置?