本文整理汇总了C#中LinearLayout.SetBackgroundDrawable方法的典型用法代码示例。如果您正苦于以下问题:C# LinearLayout.SetBackgroundDrawable方法的具体用法?C# LinearLayout.SetBackgroundDrawable怎么用?C# LinearLayout.SetBackgroundDrawable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LinearLayout
的用法示例。
在下文中一共展示了LinearLayout.SetBackgroundDrawable方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: showAd
void showAd(int idAd)
{
adOpen = true;
_adLayout = new LinearLayout (context);
_adLayout.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight (255));
Drawable dr = new BitmapDrawable (getBitmapFromAsset (adsImagesPath[idAd]));
_adLayout.SetBackgroundDrawable (dr);
_adLayout.SetY (Configuration.getHeight(1136-85-255));
_mainLayout.AddView (_adLayout);
_adLayout.Click += delegate {
context.StartActivity(Configuration.getOpenFacebookIntent(context,"fb://page/114091405281757","http://www.hi-tec.com/pe/"));
};
}
示例2: OnCreate
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
// set our layout to be the home screen
SetContentView(Resource.Layout.NotasScreen);
//Find our controls
mainLayout = FindViewById<LinearLayout>(Resource.Id.LayoutAllNotas);
taskListView = new ListView(this);
taskListView.LayoutParameters = new LinearLayout.LayoutParams (-1,-1);
//addTaskButton = FindViewById<Button> (Resource.Id.AddButton);
// wire up add task button handler
/*if(addTaskButton != null) {
addTaskButton.Click += (sender, e) => {
StartActivity(typeof(NotasItemScreen));
};
}*/
// wire up task click handler
if(taskListView != null) {
taskListView.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) => {
var taskDetails = new Intent (this, typeof (NotasItemScreen));
taskDetails.PutExtra ("TaskID", tasks[e.Position].ID);
StartActivity (taskDetails);
Finish();
};
}
Drawable dr = new BitmapDrawable (getBitmapFromAsset("images/header5.png"));
header = new LinearLayout(this);
header.LayoutParameters = new LinearLayout.LayoutParams (-1,Configuration.getHeight(125));
header.Orientation = Orientation.Vertical;
header.SetBackgroundDrawable (dr);
mainLayout.AddView(header);
mainLayout.AddView (taskListView);
}
示例3: iniMenu
private void iniMenu(){
mainLayout = new RelativeLayout (this);
_foro = new LOContainerView (this);
_dialogDownload = new ProgressDialog (this);
_dialogDownload.SetCancelable (false);
_dialogDownload.SetMessage ("Downloading...");
txtUserName = new TextView (this);
txtCurse = new TextView (this);
txtSchoolName = new TextView (this);
txtUserRol = new TextView (this);
txtPorcentaje = new TextView (this);
txtCurseTitle = new TextView (this);
txtTaskTitle = new TextView (this);
txtPendiente = new TextView (this);
txtValorBarra = new TextView (this);
imgChat = new ImageView (this);
imgUser = new ImageView (this);
imgSchool = new ImageView (this);
imgNotificacion = new ImageView (this);
imgCurse = new ImageView (this);
imgTask = new ImageView (this);
linearBarraCurso = new LinearLayout (this);
linearCurse= new LinearLayout (this);
linearSchool= new LinearLayout (this);
linearTask= new LinearLayout (this);
linearUserData= new LinearLayout (this);
linearUser = new LinearLayout (this);
linearListCurso = new LinearLayout (this);
linearListTask = new LinearLayout (this);
linearList = new LinearLayout (this);
linearPendiente = new LinearLayout (this);
linearTxtValorBarra = new LinearLayout (this);
listCursos = new ListView (this);
listTasks = new ListView (this);
mItemsChat = new List<ChatDataRow> ();
mainLayout.LayoutParameters = new RelativeLayout.LayoutParams (-1,-1);
Drawable d = new BitmapDrawable (getBitmapFromAsset ("icons/fondo.png"));
mainLayout.SetBackgroundDrawable (d);
d = null;
linearBarraCurso.LayoutParameters = new LinearLayout.LayoutParams (-1,LinearLayout.LayoutParams.WrapContent);
linearCurse.LayoutParameters = new LinearLayout.LayoutParams (-1,Configuration.getHeight(50));
linearTask.LayoutParameters = new LinearLayout.LayoutParams (-1,Configuration.getHeight(50));
linearSchool.LayoutParameters = new LinearLayout.LayoutParams (-1,LinearLayout.LayoutParams.WrapContent);
linearUserData.LayoutParameters = new LinearLayout.LayoutParams (-1,LinearLayout.LayoutParams.WrapContent);
linearUser.LayoutParameters = new LinearLayout.LayoutParams (-1, LinearLayout.LayoutParams.WrapContent);
linearListCurso.LayoutParameters = new LinearLayout.LayoutParams (-1,Configuration.getHeight(250));
linearListTask.LayoutParameters = new LinearLayout.LayoutParams (-1,LinearLayout.LayoutParams.WrapContent);
linearList.LayoutParameters = new LinearLayout.LayoutParams (-1, LinearLayout.LayoutParams.WrapContent);
linearPendiente.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth (30), Configuration.getWidth (30));
linearTxtValorBarra.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
linearBarraCurso.Orientation = Orientation.Vertical;
linearBarraCurso.SetGravity (GravityFlags.Center);
linearTxtValorBarra.Orientation = Orientation.Vertical;
linearTxtValorBarra.SetGravity (GravityFlags.Center);
txtValorBarra.Gravity = GravityFlags.Center;
linearCurse.Orientation = Orientation.Horizontal;
linearCurse.SetGravity (GravityFlags.CenterVertical);
linearTask.Orientation = Orientation.Horizontal;
linearTask.SetGravity (GravityFlags.CenterVertical);
linearSchool.Orientation = Orientation.Horizontal;
//linearSchool.SetGravity (GravityFlags.CenterVer);
linearUserData.Orientation = Orientation.Vertical;
linearUserData.SetGravity (GravityFlags.Center);
linearUser.Orientation = Orientation.Vertical;
linearUser.SetGravity (GravityFlags.CenterHorizontal);
linearListCurso.Orientation = Orientation.Vertical;
linearListTask.Orientation = Orientation.Vertical;
linearList.Orientation = Orientation.Vertical;
linearPendiente.Orientation = Orientation.Horizontal;
linearPendiente.SetGravity (GravityFlags.Center);
//linearList.SetGravity (GravityFlags.CenterVertical);
progressBar = new ProgressBar (this,null,Android.Resource.Attribute.ProgressBarStyleHorizontal);
progressBar.LayoutParameters = new ViewGroup.LayoutParams (Configuration.getWidth (274), Configuration.getHeight (32));
progressBar.ProgressDrawable = Resources.GetDrawable (Resource.Drawable.progressBackground);
progressBar.Progress = 60;
txtValorBarra.Text = "60%";
//progressBar.text
//.........这里部分代码省略.........
示例4: initItems
private void initItems()
{
var textFormat = Android.Util.ComplexUnitType.Px;
_linearContentLayout = new LinearLayout (context);
_linearContentLayout.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
_linearContentLayout.Orientation = Orientation.Vertical;
List<string> title = new List<string> ();
List<string> type = new List<string> ();
List<string> coverImagePath = new List<string> ();
List<string> numLikes = new List<string> ();
List<string> numTypes = new List<string> ();
numLikes.Add ("10");
numLikes.Add ("10");
numLikes.Add ("10");
numLikes.Add ("10");
numTypes.Add ("3");
numTypes.Add ("7");
numTypes.Add ("4");
numTypes.Add ("9");
title.Add (Resources.GetText(Resource.String.THE_ROUTES));
title.Add (Resources.GetText(Resource.String.TOURIST_SERVICE_GUIDE));
title.Add (Resources.GetText(Resource.String.WILDLIFE_IDENTIFICATION_GUIDE));
title.Add (Resources.GetText(Resource.String.INCA_TRIAL_IN_NUMBERS));
type.Add ("rutas");
type.Add ("guias");
type.Add ("guias");
type.Add ("cifras");
coverImagePath.Add ("images/fondorutas.png");
coverImagePath.Add ("images/fondoguias.png");
coverImagePath.Add ("images/fondovidasilvestre.png");
coverImagePath.Add ("images/fondocaminoinca.png");
int heightItem = Configuration.getHeight (310);
//Bitmap likeBitmap = Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/like.png"), Configuration.getWidth (30), Configuration.getWidth (30), true);
for (int i = 0; i < title.Count; i++)
{
LinearLayout item = new LinearLayout (context);
item.LayoutParameters = new LinearLayout.LayoutParams (-1, heightItem);
item.Orientation = Orientation.Horizontal;
item.SetGravity (GravityFlags.Center);
Drawable cover = new BitmapDrawable (getBitmapFromAsset(coverImagePath[i]));
item.SetBackgroundDrawable (cover);
_coverImages.Add (cover);
TextView itemTitle = new TextView (context);
itemTitle.Text = title [i];
itemTitle.SetTextColor (Color.ParseColor("#ffffff"));
itemTitle.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/ArcherMediumPro.otf");
itemTitle.SetTextSize (ComplexUnitType.Fraction, Configuration.getHeight(45));
LinearLayout linearTitle = new LinearLayout (context);
linearTitle.LayoutParameters = new LinearLayout.LayoutParams(Configuration.getWidth(465),Configuration.getHeight(180));
linearTitle.Orientation = Orientation.Vertical;
linearTitle.SetGravity (GravityFlags.Center);
linearTitle.AddView (itemTitle);
ImageView iconlike = new ImageView (context);
//iconlike.SetImageBitmap(likeBitmap);
LinearLayout linearLike = new LinearLayout (context);
linearLike.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
linearLike.Orientation = Orientation.Vertical;
linearLike.SetGravity (GravityFlags.CenterHorizontal);
TextView txtnumLike = new TextView (context);
txtnumLike.Text = numLikes[i];
txtnumLike.Gravity = GravityFlags.CenterHorizontal;
txtnumLike.SetTextColor (Color.ParseColor ("#ffffff"));
//linearLike.AddView (iconlike);
//linearLike.AddView (txtnumLike);
LinearLayout linearType = new LinearLayout (context);
linearType.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
linearType.Orientation = Orientation.Vertical;
linearType.SetGravity (GravityFlags.CenterHorizontal);
TextView txtnumType = new TextView (context);
txtnumType.Text = numTypes[i];
txtnumType.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/ArcherMediumPro.otf");
txtnumType.TextSize = Configuration.getHeight (15);
txtnumType.Gravity = GravityFlags.CenterHorizontal;
txtnumType.SetTextColor (Color.ParseColor ("#ffffff"));
//.........这里部分代码省略.........
示例5: initUi
private void initUi()
{
_mainLayout = new RelativeLayout (context);
_mainLayout.LayoutParameters = new RelativeLayout.LayoutParams (-1, -1);
_scrollItems = new VerticalScrollView (context);
_scrollItems.LayoutParameters = new VerticalScrollView.LayoutParams (-1, Configuration.getHeight(965));
_scrollItems.SetY (Configuration.getHeight (125));
initItems ();
_scrollItems.AddView (_linearContentLayout);
_mainLayout.AddView (_scrollItems);
_publicidadLayout = new LinearLayout (context);
_publicidadLayout.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight (85));
Drawable dr = new BitmapDrawable (getBitmapFromAsset ("images/footerad.jpg"));
_publicidadLayout.SetBackgroundDrawable (dr);
_publicidadLayout.SetY (Configuration.getHeight(1136-85));
_mainLayout.AddView (_publicidadLayout);
_publicidadLayout.Click += delegate {
if (adOpen) {
hideAd ();
} else {
Random rnd = new Random();
showAd (rnd.Next(adsImagesPath.Count));
}
};
}
示例6: ini
public void ini(){
Drawable dr = new BitmapDrawable (getBitmapFromAsset("images/1header.png"));
header = new LinearLayout(context);
header.LayoutParameters = new LinearLayout.LayoutParams (-1,Configuration.getHeight(125));
header.Orientation = Orientation.Horizontal;
header.SetGravity (GravityFlags.Center);
header.SetBackgroundDrawable (dr);
titulo_header = new TextView (context);
titulo_header.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth(550), -1);
titulo_header.SetTextSize (ComplexUnitType.Fraction, Configuration.getHeight(38));
titulo_header.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/ArcherMediumPro.otf");
titulo_header.SetTextColor (Color.White);
titulo_header.Gravity = GravityFlags.Center;
//titulo_header.TextAlignment = TextAlignment.Center;
placesInfoLayout = new LinearLayout (context);
placesInfoLayout.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
int space = Configuration.getWidth (30);
placesInfoLayout.SetPadding(space,space,space,space);
placesInfoLayout.Orientation = Orientation.Vertical;
_mainLayout = new RelativeLayout (context);
_mainLayout.LayoutParameters = new RelativeLayout.LayoutParams (-1,-1);
_mainLayout.AddView (header);
mapImage = new ScaleImageView (context, null);
mapImage.LayoutParameters = new LinearLayout.LayoutParams (-1, -1);
mapSpace = new LinearLayout (context);
mapSpace.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth(640), Configuration.getWidth(640));
mapSpace.SetY (Configuration.getHeight (125));
mapSpace.SetGravity (GravityFlags.Left);
mapSpace.SetBackgroundColor (Color.ParseColor ("#DFC6BB"));
//HUILLCA-----------------------------------------
mapSpaceMarker = new RelativeLayout (context);
mapSpaceMarker.LayoutParameters = new RelativeLayout.LayoutParams (Configuration.getWidth(640), Configuration.getWidth(640));
mapSpaceMarker.SetY (Configuration.getHeight (125));
mapSpaceMarker.SetGravity (GravityFlags.Left);
mapSpaceMarker.SetBackgroundColor (Color.Transparent);
iconMarker = new ImageIconMap (context);
iconMarker.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth (60), Configuration.getWidth (60));
int w = Configuration.getWidth (70);
int h = Configuration.getWidth (70);
iconMarker.SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/iconmap12.png"), w, h, true));
iconMarker.SetX (-100);
iconMarker.SetY (-100);
mapSpaceMarker.AddView (iconMarker);
var fadeIn = new AlphaAnimation(0, 1);
fadeIn.Interpolator = new AccelerateInterpolator();
fadeIn.Duration = 1000;
fadeOut = new AlphaAnimation(1, 0);
fadeOut.Interpolator = new DecelerateInterpolator();
fadeOut.Duration = 3000;
fadeOut.AnimationEnd += (s, e) =>
{
/*ThreadPool.QueueUserWorkItem(state =>
{
Thread.Sleep(2000); //wait 2 sec
//RunOnUiThread(() => iconMarker.StartAnimation(fadeOut));
});*/
iconMarker.StartAnimation(fadeIn);
iconMarker.Visibility = ViewStates.Invisible;
};
//-------------------------------------------------------
mapSpace.AddView (mapImage);
placeSpace = new VerticalScrollView (context);
placeSpace.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight(375-85));
placeSpace.SetY (Configuration.getHeight (125)+Configuration.getWidth(640));
placeSpace.SetBackgroundColor (Color.White);
placesContainer = new LinearLayout (context);
placesContainer.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight(375-85));
placesContainer.Orientation = Orientation.Vertical;
_mainLayout.AddView (mapSpace);
_mainLayout.AddView (mapSpaceMarker);//HUILLCA
_mainLayout.AddView (placeSpace);
_publicidadLayout = new LinearLayout (context);
_publicidadLayout.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight (85));
Drawable drp = new BitmapDrawable (getBitmapFromAsset ("images/footerad.jpg"));
_publicidadLayout.SetBackgroundDrawable (drp);
_publicidadLayout.SetY (Configuration.getHeight(1136-85));
_mainLayout.AddView (_publicidadLayout);
_publicidadLayout.Click += delegate {
if (adOpen) {
hideAd ();
} else {
//.........这里部分代码省略.........
示例7: ini
public void ini(){
Drawable dr = new BitmapDrawable (getBitmapFromAsset("images/1header.png"));
header = new LinearLayout(context);
header.LayoutParameters = new LinearLayout.LayoutParams (-1,Configuration.getHeight(125));
header.Orientation = Orientation.Horizontal;
header.SetGravity (GravityFlags.Center);
header.SetBackgroundDrawable (dr);
titulo_header = new TextView (context);
titulo_header.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth(550), -1);
titulo_header.SetTextSize (ComplexUnitType.Fraction, Configuration.getHeight(38));
titulo_header.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/ArcherMediumPro.otf");
titulo_header.SetTextColor (Color.White);
titulo_header.Gravity = GravityFlags.Center;
//titulo_header.TextAlignment = TextAlignment.Center;
placesInfoLayout = new LinearLayout (context);
placesInfoLayout.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
int space = Configuration.getWidth (30);
placesInfoLayout.SetPadding(space,space,space,space);
placesInfoLayout.Orientation = Orientation.Vertical;
_mainLayout = new RelativeLayout (context);
_mainLayout.LayoutParameters = new RelativeLayout.LayoutParams (-1,-1);
_mainLayout.AddView (header);
mapImage = new ScaleImageView (context, null);
mapImage.LayoutParameters = new LinearLayout.LayoutParams (-1, -1);
mapSpace = new LinearLayout (context);
mapSpace.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth(640), Configuration.getWidth(640));
mapSpace.SetY (Configuration.getHeight (125));
mapSpace.SetGravity (GravityFlags.Left);
mapSpace.SetBackgroundColor (Color.ParseColor ("#DFC6BB"));
mapSpace.AddView (mapImage);
/*
mapImage.PivotX = mapImage.Width/2;
mapImage.PivotY = mapImage.Height/2;
mapImage.ScaleX = (float)1.5;
mapImage.ScaleY = (float)1.5;
*/
placeSpace = new VerticalScrollView (context);
placeSpace.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight(375-85));
placeSpace.SetY (Configuration.getHeight (125)+Configuration.getWidth(640));
placeSpace.SetBackgroundColor (Color.White);
placesContainer = new LinearLayout (context);
placesContainer.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight(375-85));
placesContainer.Orientation = Orientation.Vertical;
_mainLayout.AddView (mapSpace);
_mainLayout.AddView (placeSpace);
_publicidadLayout = new LinearLayout (context);
_publicidadLayout.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight (85));
Drawable drp = new BitmapDrawable (getBitmapFromAsset ("images/footerad.jpg"));
_publicidadLayout.SetBackgroundDrawable (drp);
_publicidadLayout.SetY (Configuration.getHeight(1136-85));
_mainLayout.AddView (_publicidadLayout);
_publicidadLayout.Click += delegate {
if (adOpen) {
hideAd ();
} else {
Random rnd = new Random();
showAd (rnd.Next(3));
}
};
_mainLayout.AddView (leyendaLayout);
scrollPlaces = new VerticalScrollView (context);
scrollPlaces.LayoutParameters = new VerticalScrollView.LayoutParams (-1,Configuration.getHeight(1136-125-85));
scrollPlaces.AddView (placesInfoLayout);
scrollPlaces.SetY (Configuration.getHeight (125));
//mainLayout.AddView (placesInfoLayout);
//iniPlancesList ();
}
示例8: showAd
void showAd(int idAd)
{
adOpen = true;
_adLayout = new LinearLayout (context);
_adLayout.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight (255));
Drawable dr = new BitmapDrawable (getBitmapFromAsset (adsImagesPath[idAd]));
_adLayout.SetBackgroundDrawable (dr);
_adLayout.SetY (Configuration.getHeight(1136-85-255));
_mainLayout.AddView (_adLayout);
_adLayout.Click += delegate {
String url = "https://www.facebook.com/HiTecPe/";
Intent i = new Intent (Intent.ActionView);
i.SetData (Android.Net.Uri.Parse (url));
context.StartActivity(i);
};
}
示例9: ini
public void ini(){
_txtCursoN = new TextView (context);
_txtCursoN.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
_txtUnidadN = new TextView (context);
_mainLayout = new RelativeLayout (context);
linearGradiente = new LinearLayout (context);
linearGradiente.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight (310));
linearGradiente.SetBackgroundResource (Resource.Drawable.gradiente);
var textFormat = Android.Util.ComplexUnitType.Px;
_mainLayout.LayoutParameters = new RelativeLayout.LayoutParams (-1, -1);
_scrollSpace = new VerticalScrollView (context);
_scrollSpace.LayoutParameters = new VerticalScrollView.LayoutParams (-1, Configuration.getHeight(1015-85));
_scrollSpace.SetY (Configuration.getHeight (125));
//_scrollSpace.SetBackgroundColor (Color.ParseColor ("#FF0000"));
_mainLayout.AddView (_scrollSpace);
_publicidadLayout = new LinearLayout (context);
_publicidadLayout.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight (85));
Drawable dr = new BitmapDrawable (getBitmapFromAsset ("images/footerad.jpg"));
_publicidadLayout.SetBackgroundDrawable (dr);
_publicidadLayout.SetY (Configuration.getHeight(1136-85));
_mainLayout.AddView (_publicidadLayout);
_publicidadLayout.Click += delegate {
if (adOpen) {
hideAd ();
} else {
Random rnd = new Random();
showAd (rnd.Next(adsImagesPath.Count));
}
};
_mapSpace = new LinearLayout (context);
_mapSpace.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight (1015));
_mapSpace.SetY(Configuration.getHeight (125));
_mainLayout.AddView (_mapSpace);
_mainSpace = new LinearLayout (context);
_mainSpace.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
_mainSpace.Orientation = Orientation.Vertical;
_scrollSpace.AddView (_mainSpace);
_fondo2 = new RelativeLayout (context);
_fondo2.LayoutParameters = new RelativeLayout.LayoutParams (-1, Configuration.getWidth (640));
_fondo2.SetY (Configuration.getHeight (0));
Drawable dr1 = new BitmapDrawable (getBitmapFromAsset("icons/fondoselec.png"));
_fondo2.SetBackgroundDrawable (dr1);
dr1 = null;
_mainSpace.AddView (_fondo2);
infoCursoUnidad = new LinearLayout (context);
infoCursoUnidad.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight(250));
infoCursoUnidad.Orientation = Orientation.Vertical;
infoCursoUnidad.SetGravity(Android.Views.GravityFlags.Right);
infoCursoUnidad.SetPadding (Configuration.getWidth(30), Configuration.getWidth (25), Configuration.getWidth(30), Configuration.getWidth (25));
infoCursoUnidad.SetBackgroundColor (Color.ParseColor ("#40000000"));
TextView _txtCurso = new TextView (context);
_txtCurso.Text = Resource.String.THE_ROUTES.ToString ();;
_txtCurso.SetY (-100);
//section1-----------------------------------------------
_contentRLayout_S1 = new RelativeLayout(context);
_txtTitle_S1 = new TextView (context);
_txtAuthor_S1 = new TextView (context);
_imAuthor_S1 = new ImageView (context);
_txtChapter_S1 = new TextView (context);
_itemsLayout_S1 = new LinearLayout (context);//not used
_imItem_S1 = new List<ImageView> ();
_txtItem_S1 = new List<TextView>();
_contentRLayout_S1.LayoutParameters = new RelativeLayout.LayoutParams (-1, Configuration.getHeight (480));
LinearLayout _linearTitle = new LinearLayout (context);
_linearTitle.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
_linearTitle.SetGravity (Android.Views.GravityFlags.Center);
_linearTitle.AddView (_txtTitle_S1);
_linearTitle.SetY (Configuration.getHeight (60));
linearGradiente.SetX (0); linearGradiente.SetY (Configuration.getHeight(860));
//_mainLayout.AddView (linearGradiente);
//_mainLayout.AddView (_linearTitle);
//_txtTitle_S1.SetX (Configuration.getWidth (245));_txtTitle_S1.SetY (Configuration.getHeight (60));
//.........这里部分代码省略.........
示例10: ini
public void ini(){
//creating comment List
commentLayout = new LinearLayout(context);
commentLayout.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight (934));
commentList = new ListView (context);
//commentList.AddView (commentList);
//end comment List
_mainLayout = new RelativeLayout (context);
linearGradiente = new LinearLayout (context);
linearGradiente.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight (541));
linearGradiente.SetBackgroundResource (Resource.Drawable.gradiente);
var textFormat = Android.Util.ComplexUnitType.Px;
_mainLayout.LayoutParameters = new RelativeLayout.LayoutParams (-1, -1);
_fondo2 = new LinearLayout (context);
_fondo2.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getWidth (640));
_fondo2.SetY (Configuration.getHeight (109));
Drawable dr1 = new BitmapDrawable (getBitmapFromAsset("icons/fondoselec.png"));
_fondo2.SetBackgroundDrawable (dr1);
dr1 = null;
_mainLayout.AddView (_fondo2);
//section1-----------------------------------------------
_contentRLayout_S1 = new RelativeLayout(context);
_txtTitle_S1 = new TextView (context);
_txtAuthor_S1 = new TextView (context);
_imAuthor_S1 = new ImageView (context);
_txtChapter_S1 = new TextView (context);
_itemsLayout_S1 = new LinearLayout (context);//not used
_imItem_S1 = new List<ImageView> ();
_txtItem_S1 = new List<TextView>();
//_mainLayout.AddView (_txtTitle_S1);
//_mainLayout.AddView (_txtAuthor_S1);
_mainLayout.AddView (_imAuthor_S1);
//_mainLayout.AddView (_txtChapter_S1);
_contentRLayout_S1.LayoutParameters = new RelativeLayout.LayoutParams (-1, Configuration.getHeight (480));
LinearLayout _linearTitle = new LinearLayout (context);
_linearTitle.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
_linearTitle.SetGravity (Android.Views.GravityFlags.Center);
_linearTitle.AddView (_txtTitle_S1);
_linearTitle.SetY (Configuration.getHeight (60));
linearGradiente.SetX (0); linearGradiente.SetY (Configuration.getHeight(502));
_mainLayout.AddView (linearGradiente);
_mainLayout.AddView (_linearTitle);
//_txtTitle_S1.SetX (Configuration.getWidth (245));_txtTitle_S1.SetY (Configuration.getHeight (60));
Bitmap newbm = Configuration.getRoundedShape(Bitmap.CreateScaledBitmap( getBitmapFromAsset("icons/imgautor.png"), Configuration.getWidth(170), Configuration.getWidth(170), true),Configuration.getWidth(170),Configuration.getHeight(170));
_imAuthor_S1.SetImageBitmap (newbm);
// newbm.Recycle ();
newbm = null;
_imAuthor_S1.SetX (Configuration.getWidth (240));_imAuthor_S1.SetY (Configuration.getHeight (189));
LinearLayout _linearAuthor = new LinearLayout (context);
_linearAuthor.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
_linearAuthor.SetGravity (Android.Views.GravityFlags.Center);
_linearAuthor.AddView (_txtAuthor_S1);
_linearAuthor.SetY (Configuration.getHeight (378));
_mainLayout.AddView (_linearAuthor);
//_txtAuthor_S1.SetX (Configuration.getWidth (228));_txtAuthor_S1.SetY (Configuration.getHeight (378));
LinearLayout _linearChapter = new LinearLayout (context);
_linearChapter.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
//.........这里部分代码省略.........
示例11: LoadPagesDataSource
//.........这里部分代码省略.........
slidesource.ColorS = Configuration.ListaColores [indice % 6];
slidesource.Type = slides [m].lotype;
if (slides [m].lotitle != null)
slidesource.Title = slides [m].lotitle;
if (slides [m].loparagraph != null)
slidesource.Paragraph = slides [m].loparagraph;
if (slides [m].loimage != null)
slidesource.ImageUrl = slides [m].loimage;
if (slides [m].lotext != null)
slidesource.Paragraph = slides [m].lotext;
if (slides [m].loauthor != null)
slidesource.Author = slides [m].loauthor;
if (slides [m].lovideo != null)
slidesource.VideoUrl = slides [m].lovideo;
var c_slide = slides [m];
if (c_slide.loitemize != null) {
slidesource.Itemize = new ObservableCollection<LOItemSource> ();
var items = c_slide.loitemize.loitem;
for (int n = 0; n < items.Count; n++) {
LOItemSource item = new LOItemSource ();
if (items [n].loimage != null)
item.ImageUrl = items [n].loimage;
if (items [n].lotext != null)
item.Text = items [n].lotext;
var c_item_ize = items [n];
slidesource.Itemize.Add (item);
}
}
linearScroll.AddView (slidesource.getViewSlide ());
}
//linearScroll.SetPadding (padW,padH,padW,padH);
scrollPager.VerticalScrollBarEnabled = false;
if (k == 0) {
scrollPager.AddView (linearScroll);
listaScroll.Add (scrollPager);
indice++;
}
}
}
} else {
Console.WriteLine ("ERROR");
}
// }
mainLayoutPages.RemoveAllViews ();
//_progresD.Hide ();
mainLayoutPages.AddView (viewPager);
mainLayoutPages.SetX (0);
mainLayoutPages.SetY (0);
_mainLayout.AddView (mainLayoutPages);
_publicidadLayout = new LinearLayout (this);
_publicidadLayout.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight (85));
Drawable drp = new BitmapDrawable (getBitmapFromAsset ("images/footerad.jpg"));
_publicidadLayout.SetBackgroundDrawable (drp);
_publicidadLayout.SetY (Configuration.getHeight(1136-85));
_mainLayout.AddView (_publicidadLayout);
_publicidadLayout.Click += delegate {
if (adOpen) {
hideAd ();
} else {
Random rnd = new Random();
showAd (rnd.Next(adsImagesPath.Count));
}
};
LOViewAdapter adapter = new LOViewAdapter (this, listaScroll);
viewPager.Adapter = adapter;
//viewPager.CurrentItem = IndiceSection;
viewPager.SetCurrentItem (vm._currentSection, true);
}