LoginSignup
6
4

More than 5 years have passed since last update.

Xamarin.FormsでAndroidなどの物理Backキーを無効にする

Posted at

ContentPageのコードビハインドでOnBackButtonPressedをオーバーライドしてtureを返すようにすると物理BACKキーを無効にできます。

public partial class SamplePage : ContentPage
{
    public SamplePage() {
        InitializeComponent();
    }

    protected override bool OnBackButtonPressed() {
        return true;
    }
}
Navigationまわりを試行錯誤したときに気づいた方法なんですが、ぐぐると英語でたくさん出てきますね。まぁせっかくメモったのでひっそり公開しておきます。
6
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
4