void initLabels()
        {
            titleLabel = new UILabel(new CGRect(32, 0, 270, 200));
            titleLabel.LineBreakMode = UILineBreakMode.WordWrap;
            titleLabel.TextColor     = titleColor;
            titleLabel.Font          = UIFont.FromName(fontName, 24);

            Add(titleLabel);

            titleLabel.Text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit";
            var titleHeight = ReaderConstants.ResizeHeigthWithText(titleLabel, maxHeight: 960f);


            contentLabel = new UILabel(new CGRect(32, titleHeight + separation, 270, 200));
            contentLabel.LineBreakMode = UILineBreakMode.WordWrap;
            contentLabel.TextColor     = contentColor;
            contentLabel.Font          = UIFont.FromName(fontName, 16);
            Add(contentLabel);

            contentLabel.Text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. quis nostrud exercitation END";
            var contentHeight = ReaderConstants.ResizeHeigthWithText(contentLabel, maxHeight: 960f);

            slideHeight = titleHeight + contentHeight + separation + 10;
            var frame = new CGRect(0, slidePos, 320, slideHeight + 10);

            Frame = frame;
        }
 void initResizableText()
 {
     contentLabel = new UILabel(new CGRect(20, 20, 280, 100));
     contentLabel.LineBreakMode = UILineBreakMode.WordWrap;
     contentLabel.TextColor     = UIColor.Gray;
     contentLabel.Font          = UIFont.FromName(ReaderConstants.FontName, 16);
     contentLabel.Text          = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. quis nostrud exercitation END";
     contentHeight = ReaderConstants.ResizeHeigthWithText(contentLabel, maxHeight: 960f);
     slideHeight   = contentHeight + 40;
 }
Exemple #3
0
        void initLabel()
        {
            textLabel = new UILabel(new CGRect(32, topHeight, 270, 200));
            textLabel.LineBreakMode = UILineBreakMode.WordWrap;
            textLabel.TextColor     = UIColor.Gray;
            textLabel.Font          = UIFont.FromName(fontName, 16);
            Add(textLabel);

            textLabel.Text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. quis nostrud exercitation END";
            centerHeight   = ReaderConstants.ResizeHeigthWithText(textLabel, maxHeight: 960f);
        }
        void initResizableText()
        {
            titleLabel = new UILabel(new CGRect(20, 20, 250, 20));
            titleLabel.LineBreakMode = UILineBreakMode.WordWrap;
            titleLabel.TextColor     = UIColor.Purple;
            titleLabel.Font          = UIFont.FromName(ReaderConstants.FontName, 22);
            titleLabel.Text          = "Aves Tipicas";
            titleHeight = ReaderConstants.ResizeHeigthWithText(titleLabel, maxHeight: 960f);

            contentLabel = new UILabel(new CGRect(20, 20 + titleHeight + 16, 250, 200));
            contentLabel.LineBreakMode = UILineBreakMode.WordWrap;
            contentLabel.TextColor     = UIColor.Gray;
            contentLabel.Font          = UIFont.FromName(ReaderConstants.FontName, 16);
            contentLabel.Text          = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. quis nostrud exercitation END";
            contentHeight = ReaderConstants.ResizeHeigthWithText(contentLabel, maxHeight: 960f);

            borderHeight = titleHeight + contentHeight + 56;
        }
Exemple #5
0
        void initResizableText()
        {
            titleLabel = new UILabel(new CGRect(20, 20, 250, 20));
            titleLabel.LineBreakMode = UILineBreakMode.WordWrap;
            titleLabel.TextColor     = UIColor.Purple;
            titleLabel.Font          = UIFont.FromName(ReaderConstants.FontName, 22);
            titleLabel.Text          = "Aves Tipicas";
            titleHeight = ReaderConstants.ResizeHeigthWithText(titleLabel, maxHeight: 960f);

            nfloat epositon = 54;

            for (int i = 0; i < 4; i++)
            {
                ItemizeElement el = new ItemizeElement(epositon + contentHeight);
                contentHeight = el.GetPosition();
                elements.Add(el);
            }

            borderHeight = epositon + contentHeight + separation;
        }
Exemple #6
0
        void initView()
        {
            //content
            initResizableText();

            mainView = new UIView(new CGRect(15, 10, 290, 126 + contentHeight + 20));
            //mainView.Layer.BorderColor = new CGColor (48, 48, 48);
            mainView.Layer.BorderWidth = 2;
            //mainView.Layer.MasksToBounds = false;
            Add(mainView);

            //set frame
            slideHeight = mainView.Frame.Size.Height + 20;
            var frame = new CGRect(0, slidePos, 320, slideHeight);

            Frame = frame;

            //init controls
            mainView.Add(contentLabel);

            titleLabel      = ReaderConstants.GetNewTextLabel(20, 20, 256, 22, 22, UIColor.Black, 1);
            titleLabel.Text = "Aves Tipicas";
            mainView.Add(titleLabel);

            subtitleLabel = ReaderConstants.GetNewTextLabel(94, 46, 176, 48, 18, UIColor.Purple, 2);
            subtitleLabel.LineBreakMode = UILineBreakMode.WordWrap;
            subtitleLabel.Text          = "Diferentes tipos de Aves en el peru";
            mainView.Add(subtitleLabel);

            authorLabel      = ReaderConstants.GetNewTextLabel(94, 96, 176, 14, 12, UIColor.Gray, 1);
            authorLabel.Text = "Autor del Articulo";
            mainView.Add(authorLabel);

            //image
            image = new UIImageView(new CGRect(20, 46, 62, 62))
            {
                ContentMode = UIViewContentMode.ScaleToFill
            };
            image.Image = UIImage.FromFile("MLResources/default_img.png");
            mainView.Add(image);
        }
Exemple #7
0
        void initElement()
        {
            circleView = new UIView(new CGRect(0, 4, 8, 8))
            {
                BackgroundColor = BackColor
            };
            circleView.Layer.CornerRadius  = 4;
            circleView.Layer.MasksToBounds = true;
            Add(circleView);

            textLabel = new UILabel(new CGRect(18, 0, textWidth, 10));
            textLabel.LineBreakMode = UILineBreakMode.WordWrap;
            textLabel.TextColor     = UIColor.Gray;
            textLabel.Font          = UIFont.FromName(ReaderConstants.FontName, 16);
            textLabel.Text          = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. End";
            textHeight = ReaderConstants.ResizeHeigthWithText(textLabel, maxHeight: 960f);
            Add(textLabel);

            var frame = new CGRect(22, position, 250, textHeight);

            Frame = frame;
        }