本文整理汇总了C#中Android.Views.View.SetBackgroundResource方法的典型用法代码示例。如果您正苦于以下问题:C# View.SetBackgroundResource方法的具体用法?C# View.SetBackgroundResource怎么用?C# View.SetBackgroundResource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Android.Views.View
的用法示例。
在下文中一共展示了View.SetBackgroundResource方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: changeLayout
public virtual void changeLayout (View view)
{
mVideoLayout++;
if (mVideoLayout == 4) {
mVideoLayout = 0;
}
switch (mVideoLayout) {
case 0:
mVideoLayout = VideoView.VideoLayoutOrigin;
view.SetBackgroundResource (Resource.Drawable.mediacontroller_sreen_size_100);
break;
case 1:
mVideoLayout = VideoView.VideoLayoutScale;
view.SetBackgroundResource (Resource.Drawable.mediacontroller_screen_fit);
break;
case 2:
mVideoLayout = VideoView.VideoLayoutStretch;
view.SetBackgroundResource (Resource.Drawable.mediacontroller_screen_size);
break;
case 3:
mVideoLayout = VideoView.VideoLayoutZoom;
view.SetBackgroundResource (Resource.Drawable.mediacontroller_sreen_size_crop);
break;
}
mVideoView.SetVideoLayout (mVideoLayout, 0);
}
示例2: MakeText
private static AppMsg MakeText(Activity context, String text, Style style, View view, bool floating, float textSize, View.IOnClickListener clickListener)
{
AppMsg result = new AppMsg(context);
view.SetBackgroundResource(style.Background);
view.Clickable = true;
TextView tv = view.FindViewById<TextView>(Android.Resource.Id.Message);
if (textSize > 0)
{
tv.SetTextSize(Android.Util.ComplexUnitType.Sp, textSize);
}
tv.Text = text;
result.mView = view;
result.mDuration = style.Duration;
result.mFloating = floating;
view.SetOnClickListener(clickListener);
return result;
}
示例3: MakeText
private static AppMsg MakeText(Activity context, string text, Style style, View view, bool floating)
{
var result = new AppMsg(context);
view.SetBackgroundResource(style.Background);
var tv = (TextView)view.FindViewById(Android.Resource.Id.Message);
tv.Text = text;
result.View = view;
result.Duration = style.Duration;
result.SetFloating(floating);
return result;
}
示例4: ConfigureButtonContent
public void ConfigureButtonContent(View view, ExpandableItem expandableItem)
{
if (expandableItem.HasBackgroundId())
{
int backgroundId = expandableItem.BackgroundId;
view.SetBackgroundResource(backgroundId);
}
if (expandableItem.HasTitle())
{
var button = view as Button;
if (button==null)
{
return;
}
string text = expandableItem.Title;
button.Text = text;
}
if (expandableItem.HasResourceId())
{
var imageButton = view as ImageButton;
if (imageButton== null)
{
return;
}
int resourceId = expandableItem.ResourceId;
imageButton.SetImageResource(resourceId);
}
}
示例5: Build
public LinearLayout Build()
{
if(nn_itemlist.Count>0){
int number = nn_itemlist.Count;
totalwidth = (int)(cellwidth+nn_containterpadding*2);
totalheight = (int)(number*cellheight+(number-1)*nn_containerspacing+nn_containterpadding*2);
for (int i = 0; i < nn_itemlist.Count; i++) {
if (i > 0) {
//LinearLayout.LayoutParams para = (LinearLayout.LayoutParams)nn_itemlist [i].LayoutParameters;
//para.TopMargin = TapUtil.dptodx (nn_containerspacing);
//add divier;
View divider =new View(nn_context);
divider.LayoutParameters = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.MatchParent, TapUtil.dptodx (nn_containerspacing));
divider.SetBackgroundResource (Resource.Color.soarnix_bg_gray);
nn_menucontainer.AddView (divider);
}
nn_menucontainer.AddView (nn_itemlist [i]);
}
return nn_menucontainer;
}else{
Console.WriteLine ("failed add customize menu");
return null;
}
}
示例6: Refresh
private void Refresh()
{
messageHandler.RemoveCallbacks(mCountdownRunnable);
rootView.RemoveAllViews();
long currentTimeMillis = UIUtils.GetCurrentTime(Activity);
// Show Loading... and load the view corresponding to the current state
if (currentTimeMillis < UIUtils.CONFERENCE_START_MILLIS) {
SetupBefore();
} else if (currentTimeMillis > UIUtils.CONFERENCE_END_MILLIS) {
SetupAfter();
} else {
SetupDuring();
}
if (!UIUtils.IsHoneycombTablet(Activity))
{
var separator = new View(Activity);
separator.LayoutParameters = new ViewGroup.LayoutParams(1, ViewGroup.LayoutParams.FillParent);
separator.SetBackgroundResource(Resource.Drawable.whats_on_separator);
rootView.AddView(separator);
View view = Activity.LayoutInflater.Inflate(Resource.Layout.whats_on_stream, rootView, false);
view.Click += (sender, e) => {
//AnalyticsUtils.getInstance(getActivity()).trackEvent("Home Screen Dashboard", "Click", "Realtime Stream", 0);
var intent = new Intent(Activity, typeof(TagStreamActivity));
StartActivity(intent);
};
rootView.AddView(view);
}
}
示例7: UpdateSeparatorColor
void UpdateSeparatorColor(bool isHeader, AView bline)
{
if (bline == null)
return;
Color separatorColor = _listView.SeparatorColor;
if (isHeader || !separatorColor.IsDefault)
bline.SetBackgroundColor(separatorColor.ToAndroid(Color.Accent));
else
{
if (s_dividerHorizontalDarkId == int.MinValue)
{
using (var value = new TypedValue())
{
int id = global::Android.Resource.Drawable.DividerHorizontalDark;
if (_context.Theme.ResolveAttribute(global::Android.Resource.Attribute.ListDivider, value, true))
id = value.ResourceId;
else if (_context.Theme.ResolveAttribute(global::Android.Resource.Attribute.Divider, value, true))
id = value.ResourceId;
s_dividerHorizontalDarkId = id;
}
}
bline.SetBackgroundResource(s_dividerHorizontalDarkId);
}
}