如何修复它从底部滑动?是因为我使用的版本?我相信从底部滑动是按下共享按钮时的默认动画,因为它在所有应用程序中都以这种方式工作。
以下是我的gradle文件:
<item
android:id="@+id/menu_item_share"
app:showAsAction="always"
android:title="Share"
app:actionProviderClass=
"android.support.v7.widget.ShareActionProvider" />
以下是我将其添加到menu_main.xml
的方法Intent sharingIntent = new Intent(Intent.ACTION_SEND);
sharingIntent.setType("text/plain");
String shareBody = title_maps + ". Download now at Google Play Store!";
sharingIntent.putExtra(Intent.EXTRA_SUBJECT, "Share Subject");
sharingIntent.putExtra(Intent.EXTRA_TEXT, shareBody);
//set the sharing intent
mShareActionProvider.setShareIntent(sharingIntent);
编辑:
enum Counter {
case value(Int)
mutating func add(value: Int) {
// part A
var orig = self
defer { print("[part A] direct defer : ", value, "+", orig, "=", self) }
// part B
do {
var orig = self
defer { print("[part B] do block defer: ", value, "+", orig, "=", self) }
}
if case let .value(prev) = self {
self = .value(value + prev)
}
}
}
var c = Counter.value(0)
c.add(value: 10)