2014-12-03 60 views
0

這裏瀏覽其他佈局列表ViewCell是我的代碼:如何從電網使用Xamarin共享

public class BillDetailGridCell : ViewCell 
    { 
     public BillDetailGridCell() 
     { 

      Grid grid = new Grid 
      { 
       Padding = new Thickness(5, 5, 0, 0), 
       ColumnDefinitions = 
      { 
       new ColumnDefinition { Width = new GridLength(10, GridUnitType.Star) }, 
       new ColumnDefinition { Width = new GridLength(10, GridUnitType.Star) }, 
       new ColumnDefinition { Width = new GridLength(10, GridUnitType.Star) }, 
      }, 
      }; 

      Button BillIdLabel = new Button 
      { 
       //YAlign = TextAlignment.Center, 
       //XAlign = TextAlignment.Start 
       BackgroundColor = Color.Green, 
      }; 

    } 
} 

回答

0

添加項竊聽到你的列表視圖?

var listview = new ListView(); 
listview.ItemTemplate = new DataTemplate(typeof(BillDetailGridCell)); 
listview.ItemTapped += (sender, e) => 
{ 
    // navigate to another page 
}; 
相關問題