我在我的应用中创建了浮动按钮:
<android.support.design.widget.FloatingActionButton
android:id="@+id/add_fab_detail_activity"
android:layout_alignParentTop="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_add_white"
fab:backgroundTint="@color/FABNormal"
fab:rippleColor="@color/FABPressed" />在SamSung S3和Nexus6上测试时,我发现Fab在这些设备上的位置不同。我认为S3中的位置是错误的!请帮帮我!

发布于 2016-04-06 16:43:36
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
mParamsAddButton.setMargins(mMapView.getWidth() - mAddFab.getWidth()/2, mMapView.getHeight()*3/4, 0, 0);
} else {
mParamsAddButton.setMargins(mMapView.getWidth() - mAddFab.getWidth()/2, mMapView.getHeight()/2, 0, 0);
}https://stackoverflow.com/questions/36192758
复制相似问题