長時間潛伏第一次海報轉換簡單的Android項目在Xcode中運行
我有一個簡單的android項目,我被要求在iOS上運行。我不是在所有的程序員,只是一個網絡傢伙,是快速志願者的任務...
所以,這是我一直在考慮什麼去上班關閉(在Eclipse項目):
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
// Add Click listeners for all buttons
View firstButton = findViewById(R.id.button1);
firstButton.setOnClickListener(this);
View secondButton = findViewById(R.id.button2);
secondButton.setOnClickListener(this);
View thirdButton = findViewById(R.id.button3);
thirdButton.setOnClickListener(this);
View fourthButton = findViewById(R.id.button4);
fourthButton.setOnClickListener(this);
View fifthButton = findViewById(R.id.button5);
fifthButton.setOnClickListener(this);
}
// Process the button click events
public void onClick(View v) {
//based on the button clicked display associated html file
//html files are located under the assets folder
switch(v.getId()){
case R.id.button1:
Intent j = new Intent(this, Webscreen.class);
j.putExtra(Webscreen.URL, "file:///android_asset/deliver.html");
startActivity(j);
break;
case R.id.button2:
Intent k = new Intent(this, Webscreen.class);
k.putExtra(Webscreen.URL, "file:///android_asset/return.html");
startActivity(k);
break;
case R.id.button3:
Intent l = new Intent(this, Webscreen.class);
l.putExtra(Webscreen.URL, "file:///android_asset/updating.html");
startActivity(l);
break;
case R.id.button4:
Intent m = new Intent(this, Webscreen.class);
m.putExtra(Webscreen.URL, "file:///android_asset/repair.html");
startActivity(m);
break;
case R.id.button5:
Intent n = new Intent(this, Webscreen.class);
n.putExtra(Webscreen.URL, "file:///android_asset/vendor.html");
startActivity(n);
break;
}
因此,所有的功能都是在屏幕上顯示5個按鈕,點擊後它們會打開一個本地html文件。
任何人都有一些很好的例子來看待在Xcode中做類似的事情嗎?我正在嘗試使用Web視圖,但我沒有太多運氣。我設法得到了一些與記分板一起工作的東西,但是這個應用程序在以前的iOS版本中必須有價值,而不僅僅是5.0。
在此先感謝任何/所有的幫助!