示例#1
0
        void initComponent()
        {
            iconBar = new IconSlideBar();
            Add(iconBar);

            if (source.Type != 0)
            {
                if (source.Style.ColorNumber != 0)
                {
                    iconBar.ImageUrl = "iOS Resources/ricons/estilo" + source.Style.ID + "_color" + source.Style.ColorNumber + "-0" + source.Type + ".png";
                }
                else
                {
                    iconBar.ImageUrl = "iOS Resources/ricons/tema5_colorblanco-0" + source.Type + ".png";
                }
                iconBar.LineColor = source.Style.TitleColor;
            }

            title.Text     = source.Title.ToUpper();
            paragraph.Text = source.Paragraph;

            /*resize height according to text*/
            int expectedHeight = Constants.resizeUILabelHeight(paragraph.Text, paragraph.Font, paragraph.Frame.Width);

            paragraph.Frame = new CGRect(0, 160, paragraph.Frame.Width, expectedHeight);


            contentScroll.ContentSize = new CGSize(380, 160 + expectedHeight + 10);
            title.TextColor           = source.Style.TitleColor;
            paragraph.TextColor       = source.Style.ContentColor;

            //var url = new NSUrl (Source.ImageUrl);
            //var data = NSData.FromUrl (url);
            //image.Image = UIImage.LoadFromData (data);


            //downloadImageWithURL (new NSUrl(Source.ImageUrl));

            Constants.DownloadImageAsync(Source.ImageUrl).ContinueWith((task) => InvokeOnMainThread(() =>
            {
                try { image.Image = task.Result; }
                catch { }
            }));

            view.BackgroundColor = Source.Style.TitleColor;

            BackgroundColor = Source.Style.Background;
        }
示例#2
0
        void initComponent()
        {
            var iconBar = new IconSlideBar();

            Add(iconBar);

            if (source.Type != 0)
            {
                if (source.Style.ColorNumber != 0)
                {
                    iconBar.ImageUrl = "iOS Resources/ricons/estilo" + source.Style.ID + "_color" + source.Style.ColorNumber + "-0" + source.Type + ".png";
                }
                else
                {
                    iconBar.ImageUrl = "iOS Resources/ricons/tema5_colorblanco-0" + source.Type + ".png";
                }
                iconBar.LineColor = source.Style.TitleColor;
            }

            //ITEMS
            title.Text = source.Title.ToUpper();

            int expectedHeight = Constants.resizeUILabelHeight(title.Text, title.Font, title.Frame.Width);

            title.Frame = new CGRect(0, 0, title.Frame.Width, expectedHeight);

            nfloat yPos = expectedHeight + 20;

            /*resize height according to text*/
            for (int i = 0; i < source.Itemize.Count; i++)
            {
                var item = new LOItem(yPos)
                {
                    TextContent = source.Itemize[i].Text,
                    TextColor   = Source.Style.ContentColor,
                    BulletColor = Source.Style.TitleColor
                };
                contentScroll.Add(item);
                yPos += item.Frame.Height;
            }


            contentScroll.ContentSize = new CGSize(380, yPos + 20);
            title.TextColor           = source.Style.TitleColor;
            BackgroundColor           = Source.Style.Background;
        }
示例#3
0
        void initComponent()
        {
            iconBar = new IconSlideBar();
            Add(iconBar);

            if (source.Type != 0)
            {
                if (source.Style.ColorNumber != 0)
                {
                    iconBar.ImageUrl = "iOS Resources/ricons/estilo" + source.Style.ID + "_color" + source.Style.ColorNumber + "-0" + source.Type + ".png";
                }
                else
                {
                    iconBar.ImageUrl = "iOS Resources/ricons/tema5_colorblanco-0" + source.Type + ".png";
                }
                iconBar.LineColor = source.Style.TitleColor;
            }

            title.Text     = source.Title.ToUpper();
            paragraph.Text = source.Paragraph;

            int expectedHeight = Constants.resizeUILabelHeight(title.Text, title.Font, title.Frame.Width);

            title.Frame = new CGRect(0, 0, title.Frame.Width, expectedHeight);

            /*resize height according to text*/

            expectedHeight  = Constants.resizeUILabelHeight(paragraph.Text, paragraph.Font, paragraph.Frame.Width);
            paragraph.Frame = new CGRect(0, 20 + title.Frame.Height, paragraph.Frame.Width, expectedHeight);


            contentScroll.ContentSize = new CGSize(380, paragraph.Frame.Y + expectedHeight + 10);
            title.TextColor           = source.Style.TitleColor;
            paragraph.TextColor       = source.Style.ContentColor;
            BackgroundColor           = Source.Style.Background;
        }
示例#4
0
        void initComponent()
        {
            var iconBar = new IconSlideBar();

            Add(iconBar);

            if (source.Type != 0)
            {
                if (source.Style.ColorNumber != 0)
                {
                    iconBar.ImageUrl = "iOS Resources/ricons/estilo" + source.Style.ID + "_color" + source.Style.ColorNumber + "-0" + source.Type + ".png";
                }
                else
                {
                    iconBar.ImageUrl = "iOS Resources/ricons/tema5_colorblanco-0" + source.Type + ".png";
                }
                iconBar.LineColor = source.Style.TitleColor;
            }

            title.Text      = source.Title.ToUpper();
            title.TextColor = source.Style.TitleColor;
            BackgroundColor = source.Style.Background;

            for (int i = 0; i < source.Itemize.Count; i++)
            {
                var item = source.Itemize [i];
                switch (i)
                {
                case 0:
                    name1.Text = item.Text;
                    name1.SizeToFit();
                    name1.TextColor       = source.Style.ContentColor;
                    view1.BackgroundColor = source.Style.TitleColor;

                    Constants.DownloadImageAsync(item.ImageUrl).ContinueWith((task) => InvokeOnMainThread(() => {
                        try { image1.Image = task.Result; }
                        catch { }
                    }));

                    view1.UserInteractionEnabled = true;

                    break;

                case 1:
                    name2.Text = item.Text;
                    name2.SizeToFit();

                    name2.TextColor       = source.Style.ContentColor;
                    view2.BackgroundColor = source.Style.TitleColor;

                    Constants.DownloadImageAsync(item.ImageUrl).ContinueWith((task) => InvokeOnMainThread(() => {
                        try { image2.Image = task.Result; }
                        catch { }
                    }));

                    view2.UserInteractionEnabled = true;

                    break;

                case 2:
                    name3.Text = item.Text;
                    name3.SizeToFit();

                    name3.TextColor       = source.Style.ContentColor;
                    view3.BackgroundColor = source.Style.TitleColor;

                    Constants.DownloadImageAsync(item.ImageUrl).ContinueWith((task) => InvokeOnMainThread(() => {
                        try { image3.Image = task.Result; }
                        catch { }
                    }));

                    view3.UserInteractionEnabled = true;

                    break;
                }
            }
        }