2017-06-15 9 views
-1

最近Visual StudioにXamarinをインストールして、基本的にC#でAndroidアプリケーションを作成しましたが、問題が発生しました。 私はアプリケーションを構築しようとした際、表示するウィンドウがデザイナウィンドウに異なっている: -> The Windows <-Visual StudioのアプリケーションUIビルダーAndroid開発が動作しない

Main.axml:

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:minWidth="25px" 
    android:minHeight="25px"> 
    <Button 
     android:text="Button" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:id="@+id/button1" /> 
</LinearLayout> 

MainActivity.cs:

using Android.App; 
using Android.Widget; 
using Android.OS; 

namespace RemindMe 
{ 
    [Activity(Label = "RemindMe", MainLauncher = true, Icon = "@drawable/icon")] 
    public class MainActivity : Activity 
    { 
     protected override void OnCreate(Bundle bundle) 
     { 
      base.OnCreate(bundle); 

      // Set our view from the "main" layout resource 
      // SetContentView (Resource.Layout.Main); 
      Toast.MakeText(this.ApplicationContext, "Welcome! This app is currently under construction...", ToastLength.Short).Show(); 

     } 
    } 
} 
+0

Visibleプロパティがfalseの場合は、コードを投稿して詳細を確認してください。 –

+0

axmlファイルですか? - その文字通り単なるボタン。 – Exus

+0

ありがとうございました。 Theresはあまりありません – Exus

答えて

0

あなたはしなければなりませんSetContentView (Resource.Layout.Main)を使用すると、このメソッドはレイアウトリソースからアクティビティコンテンツを設定します。 Hereは文書です。

関連する問題