2010-10-21 69 views
2

你好 我想爲可點擊天數的android創建月視圖日曆。我應該使用什麼樣的佈局/視圖,TableLayout或GridView。我沒有找到任何的例子此...GridView與TableLayout | Android

感謝您的幫助提前

回答

2

我想說GridView,特別是如果你打算把所有的日曆數據在ContentProvider與其他應用程序共享。然後,您可以使用您的供應商和適配器,以填補在GridView動態

+0

感謝您的幫助,我會看看 – 2010-10-22 06:41:56

+0

@schwiz我在我的項目中使用了GridView,但我不想在GridView中滾動。好心建議我做什麼。 – 2012-03-13 11:30:49

2

檢查GridView中休耕教程:

http://www.firstdroid.com/2011/02/06/android-tutorial-gridview-with-icon-and-text/

瞭解本教程後,就在的末尾添加休耕線onCreate方法:

grid_main.setOnItemClickListener(new OnItemClickListener() { 
    public void onItemClick(AdapterView<?> parent, View view, int position, 
          long id) { 

     // Add your code here, you receive the index, 
     // you can start an intent or do whatever you wanted 
     // to do with the button 

    }/* End of onItemClick */ 
}); 

BR,

阿德里安。