五子棋一定要在AndroidStudio里面寫嘛?在eclipse里面寫的運(yùn)行不出來……
eclipse的xml布局文件可以這么寫嘛?
<zlin.wuziqi.WuziqiPanel
??
不知道為啥都運(yùn)行不出來,oncreate里面的?setContentView(R.layout.activity_main);
都執(zhí)行不了
public?class?MainActivity?extends?Activity?{ ????@Override ????protected?void?onCreate(Bundle?savedInstanceState)?{ ????????super.onCreate(savedInstanceState); ????????setContentView(R.layout.activity_main); ????} }
布局文件也是按照老師的寫的
<RelativeLayout? ????xmlns:android="http://schemas.android.com/apk/res/android" ????xmlns:tools="http://schemas.android.com/tools" ????android:layout_width="match_parent" ????android:layout_height="match_parent" ????android:background="@drawable/bg" ????tools:context="${relativePackage}.${activityClass}"?> ????<zlin.wuziqi.WuziqiPanel ????????android:id="@+id/id_panel" ????????android:layout_gravity="center" ????????android:layout_width="match_parent" ????????android:layout_height="match_parent"/> </RelativeLayout>
2017-04-15
eclipse上可以寫。
<RelativeLayout?
????<zlin.wuziqi.WuziqiPanel
????????android:id="@+id/id_panel"
????????android:layout_gravity="center"
????????android:layout_width="match_parent"
????????android:layout_height="match_parent"/>
</RelativeLayout>
加粗的地方看有沒有寫錯(cuò),要寫成你的包名加上放置view的class名。
? 例如:
? ? <com.syp.test.WuziqiPanel
2017-02-11
沒有什么太大的區(qū)別,我是在eclipse上寫的,如果要源碼可以私聊我
2017-01-04
請(qǐng)檢查一下WuziqiPanel命名空間路徑是否完整/是否正確