【Mono for Android】應用開發初探(2)
阿新 • • 發佈:2018-11-07
這是效果圖。但是新建 OpenGL 遊戲(Android) Visual C# 工程時,遇到了問題。
即使我在AndroidManifest.xml中添加了網路許可權
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
仍然開啟APP就閃退。
我找到了這樣一篇文章:http://www.c-sharpcorner.com/UploadFile/093731/create-opengl-mono-for-android-application3/
察覺到自己的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="fill_parent" android:layout_height="fill_parent"> </LinearLayout>
然後就顯示正常了。