我发现,从Apple应用程序开发开始,你需要有一些Mac.我想知道是否可以为此目的在Amazon EC2实例上加载Mac OSx的图像.
我有一个带有两个选项卡的TabActivity.活动的布局如下:
<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout android:orientation="vertical"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:padding="5dp">
<TabWidget android:id="@android:id/tabs"
android:layout_width="fill_parent" android:layout_height="wrap_content" />
<FrameLayout android:id="@android:id/tabcontent"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:padding="5dp">
<ListView android:id="@+id/list"
android:layout_width="fill_parent" android:layout_height="fill_parent" />
</FrameLayout>
</LinearLayout>
</TabHost>
Run Code Online (Sandbox Code Playgroud)
布局由ListView组成,ListView在setOnTabChangedListener()中相应地填充.填写列表并显示它没有问题.
我的问题是活动开始时列表视图没有显示,虽然我通过ID找到它并填充它; 它仅在我更改选项卡后填充.
并且onCreate(..)中的代码如下所示:
l = (ListView) findViewById(R.id.list);
l.setAdapter(new CommentsAdapter(this, (JSONArray) obj));
TabSpec spec;
spec = tabHost.newTabSpec("0").setIndicator("0",
res.getDrawable(R.drawable.tab_recent)).setContent(
R.id.list);
tabHost.addTab(spec);
spec = tabHost.newTabSpec("1").setIndicator("1",
res.getDrawable(R.drawable.tab_pop)).setContent(
R.id.list);
tabHost.addTab(spec);
tabHost.setOnTabChangedListener(new OnTabChangeListener() {
@Override
public void onTabChanged(String tabId) {
// TODO Auto-generated method stub
int tab = Integer.valueOf(tabId);
showDialog(WAIT_DIALOG);
switch (tab) { …Run Code Online (Sandbox Code Playgroud) 我正在解析来自Web服务的响应.在解析器部分,我有这样的事情:
foreach ($resXml->readCalls->classify->classification ->class as $d) {
... do some processing
}
问题是,作为我的xml响应中的子节点的'class'术语被误认为是php中的'class'关键字,这会引发编译错误.
我怎样才能在php中使用偶然成为关键字的术语?
谢谢!