![](/img/trans.png)
[英]How do I use a layout xml file in a tab under the standard swipe+tab model
[英]I want to introduce XML into tab! how to do this?
我想使用此http://technicalmumbojumbo.wordpress.com/2011/12/08/android-tutorial-series-layout/的最新示例“ TabLayout”
我想向CoffeeShopListActivity引入高度為300dpi的XML。 我創建了一個主要的XML。 然后我放了coffee._layout.xml,在其中插入了文本“ hello”:
我有main.xml和coffee._layout.xml
我失敗了。 你能幫助我嗎。 非常感謝!
我注意到您在coffee._layout中放置了一段時間,這是拼寫錯誤嗎? 如果是這樣,則您在該網站底部的注釋中復制並粘貼的代碼的XML文件名錯誤。
您需要更改此:
setContentView(R.layout.coffe_layout);
對此:
setContentView(R.layout.coffee_layout);
如果仍不能解決問題,請發布XML文件,Java文件的代碼以及收到的任何錯誤,以進行更好的故障排除。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.