私はAndroidアプリケーションを作成しています。その背景にカスタム背景画像のボタンがあります。背景画像は単なる矩形ですが、ボタンのテキストは垂直に中央揃えされていないようです。ここでは、ボタンのための私のxmlです:ボタンのテキストがボタンの中央に垂直にならない
<Button
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"></Button>
は、私はここに背景を設定:
ImageView button_bg = (ImageView)findViewById(R.id.button_background);
savetolist_button.setBackgroundDrawable(button_bg.getDrawable());
ボタン内のテキストの位置を変更するところはありますか?