本文整理汇总了C#中ImageView.SetBackgroundDrawable方法的典型用法代码示例。如果您正苦于以下问题:C# ImageView.SetBackgroundDrawable方法的具体用法?C# ImageView.SetBackgroundDrawable怎么用?C# ImageView.SetBackgroundDrawable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImageView
的用法示例。
在下文中一共展示了ImageView.SetBackgroundDrawable方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnCreate
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
SetContentView (Resource.Layout.customer_calling_layout);
bloaded = false;
ActionBar.NavigationMode = ActionBarNavigationMode.Standard;
ActionBar.SetTitle(Resource.String.calling_title);
ActionBar.SetDisplayShowTitleEnabled (false);
ActionBar.SetDisplayHomeAsUpEnabled(true);
ActionBar.SetDisplayShowHomeEnabled (true);
setHeadingTitle (Resource.String.calling_title);
callingActivity = this;
llProgress = FindViewById<LinearLayout> (Resource.Id.llProgressBar);
llProgress.Visibility = ViewStates.Gone;
tvName = FindViewById<TextView> (Resource.Id.tv_name_spec_calling);
tvTimeDuration = FindViewById<TextView> (Resource.Id.tv_time_customer_calling);
tvCostDuration = FindViewById<TextView> (Resource.Id.tv_cost_customer_calling);
img_upfile = FindViewById<ImageView> (Resource.Id.img_upfile_calling);
var avatar = FindViewById<ImageView> (Resource.Id.img_avatar_customer_calling);
llFileAttach = FindViewById<LinearLayout> (Resource.Id.ll_file_attach_customer_calling);
// Follow up action
llGrFollowUpAction = FindViewById<LinearLayout> (Resource.Id.llGrFollowUpAction);
imgRatingFollowUp = FindViewById<ImageView> (Resource.Id.imgRatingFolowUp);
imgFavoriteFollowUp = FindViewById<ImageView> (Resource.Id.imgFavoriteFolowUp);
imgEmailFollowUp = FindViewById<ImageView> (Resource.Id.imgEmailFollowUp);
imgWaiveFeeFollowUp = FindViewById<ImageView> (Resource.Id.imgWaiveFeeFollowUp);
imgTranscribeFollowUp = FindViewById<ImageView> (Resource.Id.imgTranscribeFollowUp);
imgUpPhotoFollowUp = FindViewById<ImageView> (Resource.Id.imgUpPhotoFollowUp);
imgReplayFollowUp = FindViewById<ImageView> (Resource.Id.imgReplayFollowUp);
llRatingFollowUp = FindViewById<LinearLayout> (Resource.Id.llRatingFollowUp);
llFavoriteFollowUp = FindViewById<LinearLayout> (Resource.Id.llFavoriteFollowUp);
llEmailFollowUp = FindViewById<LinearLayout> (Resource.Id.llEmailFollowUp);
llWaiveFollowUp = FindViewById<LinearLayout> (Resource.Id.llWaiveFeeFollowUp);
llTransribeFollowUp = FindViewById<LinearLayout> (Resource.Id.llTranscribeFollowUp);
llUpphotoFollowUp = FindViewById<LinearLayout> (Resource.Id.llUploadPhotoFollowUp);
llReplayFollowUp = FindViewById<LinearLayout> (Resource.Id.llReplayFollowUp);
tvWaiveFeeNotice = FindViewById<TextView> (Resource.Id.tv_notice_waived_calling);
UrlImageViewHelper.UrlImageViewHelper.SetUrlDrawable (avatar, HttpConstants.BASE_URL + constants.durationInfo.AvatarPath, Resource.Drawable.special_home, constants.iTimeLoading, this);
tvName.Text = constants.durationInfo.UserFullName;
llGrFollowUpAction.Visibility = ViewStates.Gone;
uploadPhoto = new UploadPhoto(this);
uploadPhoto.actionUploadPhotoDelegate = this;
deleteFile = new Teleconsult.Android.DeleteFile (this);
deleteFile.deleteFileAction = this;
// Action
Background bgUpfile = new Background (this, Resource.Drawable.camera, Resource.Drawable.camera_pressed);
img_upfile.SetBackgroundDrawable (bgUpfile);
img_upfile.Click += (sender, e) => {
if(uploadPhoto == null){
uploadPhoto = new UploadPhoto(this);
uploadPhoto.actionUploadPhotoDelegate = this;
}
uploadPhoto.selectActionUpload();
};
Background bgRating = new Background (this, Resource.Drawable.icon_feedback, Resource.Drawable.icon_feedback_pressed);
imgRatingFollowUp.SetBackgroundDrawable (bgRating);
imgRatingFollowUp.Click += (sender, e) => {
if(isFeeback) {
if(dialogFeedbackReview == null){
dialogFeedbackReview = new RatingFeedbackReview(this);
}
dialogFeedbackReview.showFeedbackReview(iRatingNumber, sFeedBackContent);
} else {
if(dialogFeedback == null){
dialogFeedback = new RatingFeedbackUI(this, callId);
dialogFeedback.actionRatingDelegate = this;
}
dialogFeedback.showRatingFeedback();
}
};
imgFavoriteFollowUp.Click += (sender, e) => {
if (isFavorite) {
if(dialogFavorite == null){
dialogFavorite = new FavoriteUI(this);
dialogFavorite.actionFavoriteDelegate = this;
}
dialogFavorite.removeFavoriteRequest(specId);
} else {
if(dialogFavorite == null){
dialogFavorite = new FavoriteUI(this);
dialogFavorite.actionFavoriteDelegate = this;
}
dialogFavorite.addToFavouriteRequest(specId);
}
//.........这里部分代码省略.........
示例2: displayNewIcon
private void displayNewIcon()
{
float[] newSizes = new float[2];
newSizes [0] = newSizes [1] = 100f;
if (option == 2 || option == 5)
ib.Visibility = pb.Visibility = ViewStates.Visible;
if (option == 6)
{
string base64String = System.Convert.ToBase64String(ContentPackItemsUtil.content, 0, ContentPackItemsUtil.content.Length);
RunOnUiThread(delegate
{
if (wowZapp.LaffOutOut.Singleton.resizeFonts)
{
newSizes [0] *= wowZapp.LaffOutOut.Singleton.bigger;
newSizes [1] = newSizes [0];
}
WebView wv = new WebView(context);
string url = "<img src=\"data:image/gif;base64," + base64String + "\" width=\"" + ((int)newSizes [0]).ToString() + "\" height=\"" + ((int)newSizes [1]).ToString() + "\" />";
wv.LoadDataWithBaseURL(null, url, "text/html", "UTF-8", null);
wv.VerticalScrollBarEnabled = false;
wv.HorizontalScrollBarEnabled = false;
wv.LayoutParameters = new ViewGroup.LayoutParams((int)ImageHelper.convertDpToPixel(newSizes [0], context), (int)ImageHelper.convertDpToPixel(newSizes [1], context));
wv.SetBackgroundColor(Android.Graphics.Color.Transparent);
webImages = wv;
layout.AddView(wv);
btnAdd.Visibility = ViewStates.Visible;
btnSend.Visibility = ViewStates.Visible;
});
} else
{
if (option == 2 || option == 5)
{
pb.Visibility = ib.Visibility = ViewStates.Visible;
ib.Click += delegate
{
playAudio(pb);
};
}
RunOnUiThread(delegate
{
MemoryStream stream = new MemoryStream(ContentPackItemsUtil.content);
Android.Graphics.Drawables.Drawable draw = Android.Graphics.Drawables.Drawable.CreateFromStream(stream, "Profile");
ImageView preview = new ImageView(context);
preview.LayoutParameters = new ViewGroup.LayoutParams((int)ImageHelper.convertDpToPixel(newSizes [0], context), (int)ImageHelper.convertDpToPixel(newSizes [1], context));
preview.SetScaleType(ImageView.ScaleType.FitXy);
preview.SetBackgroundDrawable(draw);
images = preview;
layout.AddView(preview);
btnAdd.Visibility = ViewStates.Visible;
btnSend.Visibility = ViewStates.Visible;
});
}
}