本文整理汇总了C#中ListView.SetBackgroundColor方法的典型用法代码示例。如果您正苦于以下问题:C# ListView.SetBackgroundColor方法的具体用法?C# ListView.SetBackgroundColor怎么用?C# ListView.SetBackgroundColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ListView
的用法示例。
在下文中一共展示了ListView.SetBackgroundColor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetSampleContent
public override View GetSampleContent (Context context)
{
btn = new Button(context);
btn.SetBackgroundResource(Resource.Drawable.burgericon);
FrameLayout.LayoutParams btlayoutParams = new FrameLayout.LayoutParams(42,32, GravityFlags.Center);
btn.LayoutParameters = btlayoutParams;
btn.SetPadding (10,0,0,0);
btn.Gravity=GravityFlags.CenterVertical;
TextView textView = new TextView(context);
textView.TextSize=20;
textView.Text="Home";
textView.SetTextColor (Color.White);
textView.Gravity=GravityFlags.Center;
LinearLayout linearLayout = new LinearLayout(context);
FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, 70, GravityFlags.Center);
layoutParams.SetMargins (10,0,0,0);
linearLayout.SetPadding (10,0,0,0);
linearLayout.AddView(btn);linearLayout.AddView(textView,layoutParams);
linearLayout.SetBackgroundColor(Color.Rgb(47,173,227));
height = context.Resources.DisplayMetrics.HeightPixels-75;
width =context.Resources.DisplayMetrics.WidthPixels;
LinearLayout linear2 = new LinearLayout(context);
linear2.Orientation=Orientation.Vertical;
linear2.LayoutParameters = new ViewGroup.LayoutParams (ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
FrameLayout.LayoutParams layout2= new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent, GravityFlags.Center);
linear2.AddView(linearLayout,layout2);
/**
* Main Content
* */
FrameLayout gridLayout = new FrameLayout(context);
gridLayout.LayoutParameters=new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
/**
* item1
*/
FrameLayout grid1 = new FrameLayout(context);
ImageView img1 = new ImageView(context);
img1.SetScaleType (ImageView.ScaleType.FitXy);
img1.SetImageResource(Resource.Drawable.profile);
FrameLayout.LayoutParams layoutParams1 = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent, GravityFlags.Center);
grid1.AddView(img1, layoutParams1);
grid1.LayoutParameters=new ViewGroup.LayoutParams((width-20) / 2,(height - 100)/3);
/**
* item2
*/
FrameLayout grid2 = new FrameLayout(context);
ImageView img2 = new ImageView(context);
img2.SetImageResource(Resource.Drawable.inbox);
img2.SetScaleType (ImageView.ScaleType.FitXy);
grid2.AddView(img2, layoutParams1);
grid2.LayoutParameters=new ViewGroup.LayoutParams((width-20) / 2,(height - 100)/3);
/**
* item3
*/
FrameLayout grid3 = new FrameLayout(context);
ImageView img3 = new ImageView(context);
img3.SetImageResource(Resource.Drawable.outbox);
img3.SetScaleType (ImageView.ScaleType.FitXy);
grid3.AddView(img3, layoutParams1);
grid3.LayoutParameters=new ViewGroup.LayoutParams((width-20) / 2,(height - 100)/3);
/**
* item4
*/
FrameLayout grid4 = new FrameLayout(context);
ImageView img4 = new ImageView(context);
img4.SetImageResource(Resource.Drawable.flag);
img4.SetScaleType (ImageView.ScaleType.FitXy);
grid4.AddView(img4, layoutParams1);
grid4.LayoutParameters=new ViewGroup.LayoutParams((width-20) / 2,(height - 100)/3);
/**
* item5
*/
FrameLayout grid5 = new FrameLayout(context);
ImageView img5 = new ImageView(context);
img5.SetImageResource(Resource.Drawable.trash);
img5.SetScaleType (ImageView.ScaleType.FitXy);
//.........这里部分代码省略.........