在android中添加布局的过程,在layout-land中定义的xml布局没有出现在android应用程序中...
我正在根据
this example开发应用程序.我在layout-land文件夹中为header.xml定义了横向布局,但是当我将方向更改为横向时,定义的布局不会出现在屏幕中.
知道为什么吗?
谢谢
更新 :
活动代码:
public class ACENewsFeedActivity extends ListActivity {
// Progress Dialog
private ProgressDialog pDialog;
// Array list for list view
ArrayList> rssItemList = new ArrayList>();
RSSParser rssParser = new RSSParser();
List rssItems = new ArrayList();
RssFeed rssFeed;
private static String TAG_TITLE = "title";
private static String TAG_LINK = "link";
private static String TAG_DESRIPTION = "description";
private static String TAG_PUB_DATE = "pubDate";
//private static String TAG_GUID = "guid"; // not used
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.rss_item_list);
/**
* Calling a backgroung thread will loads recent articles of a website
* @param rss url of website
* */
new loadRSSFeedItems().execute();
}
....
}
横向模式下的XMl布局:
android:id="@+id/layoutHeader"
android:layout_width="fill_parent"
android:layout_height="50dip"
android:layout_alignParentTop="true"
android:background="@layout/header_gradient"
android:orientation="horizontal">
android:id="@+id/btnAddSite"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="5dip"
android:background="@null"
android:src="@drawable/plus"
android:layout_centerVertical="true" />
android:id="@+id/logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:src="@drawable/logo" />
android:id="@+id/refreshList"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:src="@drawable/refresh" />
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐


所有评论(0)