Android 按钮在旋转到横向后和旋转回来后看起来不同

Android button looks different after rotating to landscape and still after rotating back

我按照 this 教程创建了我的按钮。看起来还不错。

但是如果我将设备屏幕旋转为横向,按钮看起来会有所不同。 你知道为什么会这样吗? 如果您需要一些代码,请告诉我!

按钮应该是:

旋转后的按钮:

我建议您使用 Android Design Support Library 中包含的 FloatingActionButton。

只需将 compile 'com.android.support:design:22.2.0' 添加到您的 Gradle 文件,并在您的布局中使用 FloatingActionBar 视图 class!

示例:

<android.support.design.widget.FloatingActionButton
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:clickable="true"
    android:src="@drawable/your_drawable" />