2014-12-03 78 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 
};