Creating ScrollView with Text and Image

What is the best way to create a scrollview that should contain Image and Text?
The text and the image date are set dynamically.
Image and Text should be scrollable as one entity (NOT scrollable separately).
I don't really know how to determine the sizes of each elements ...
For example I can't make :
UITextView *tmpTxt = [[UITextView alloc] initWithFrame: CGRectMake(0.0f, 0.0f, 320.0f, 480.0f)];
... because I have no height value determined yet as I don't know how long will be the text.
Could you please help me to move forward ??
Message was edited by: fatter

To calculate text size of for example in 15 points, you could use the following type of function.
- (CGSize)calculateSizeOfString:(NSString *)text {
CGSize textSize = [text sizeWithFont:[UIFont systemFontOfSize:15.0] constrainedToSize:CGSizeMake(320, 9999) lineBreakMode:UILineBreakModeWordWrap];
return textSize;
Then, you can access the width & height, by querying the value of textSize.width and textSize.height.

Similar Messages

  • How can i copy line with text and image to ms word

    When I insert an image in textflow using InlineGraphicElement it works, but when I copy the line with the image to MS Word it copies only the text (not the image).
    How can i copy the image to MS Word?

    If you want copy formatted text and image to MS Word, you need to give MS Word rtf markup, because Word can recognize rtf markup but not TLF markup.
    So you need to create a custom clipboard to paste a rtf markup. It's a large feature for you, because you need a tlf-rtf converter in your custom clipboard.
    TLF Custom Clipboard Example:
    package
        import flash.display.Sprite;
        import flash.desktop.ClipboardFormats;
        import flashx.textLayout.container.ContainerController;
        import flashx.textLayout.conversion.ITextImporter;
        import flashx.textLayout.conversion.TextConverter;
        import flashx.textLayout.edit.EditManager;
        import flashx.textLayout.elements.*;
        import flashx.undo.UndoManager;
        // Example code to install a custom clipboard format. This one installs at the front of the list (overriding all later formats)
        // and adds a handler for plain text that strips out all consonants (everything except aeiou).
        public class CustomClipboardFormat extends Sprite
            public function CustomClipboardFormat()
                var textFlow:TextFlow = setup();
                TextConverter.addFormatAt(0, "vowelsOnly_extraList", VowelsOnlyImporter, AdditionalListExporter, "air:text" /* it's a converter for cliboard */);
            private const markup:String = '<TextFlow whiteSpaceCollapse="preserve" version="2.0.0" xmlns="http://ns.adobe.com/textLayout/2008"><p><span color=\"0x00ff00\">Anything you paste will have all consonants removed.</span></p></TextFlow>';
            private function setup():TextFlow
                var importer:ITextImporter = TextConverter.getImporter(TextConverter.TEXT_LAYOUT_FORMAT);
                var textFlow:TextFlow = importer.importToFlow(markup);
                textFlow.flowComposer.addController(new ContainerController(this,500,200));
                textFlow.interactionManager = new EditManager(new UndoManager());
                textFlow.flowComposer.updateAllControllers();
                return textFlow;
    import flashx.textLayout.conversion.ITextExporter;
    import flashx.textLayout.conversion.ConverterBase;
    import flashx.textLayout.conversion.ITextImporter;
    import flashx.textLayout.conversion.TextConverter;
    import flashx.textLayout.elements.IConfiguration;
    import flashx.textLayout.elements.TextFlow;
    class VowelsOnlyImporter extends ConverterBase implements ITextImporter
        protected var _config:IConfiguration = null;
        /** Constructor */
        public function VowelsOnlyImporter()
            super();
        public function importToFlow(source:Object):TextFlow
            if (source is String)
                var firstChar:String = (source as String).charAt(0);
                firstChar = firstChar.toLowerCase();
                // This filter only applies if the first character is a vowel
                if (firstChar == 'a' || firstChar == 'i' || firstChar == 'e' || firstChar == 'o' || firstChar == 'u')
                    var pattern:RegExp = /([b-df-hj-np-tv-z])*/g;
                    source = source.replace(pattern, "");
                    var importer:ITextImporter = TextConverter.getImporter(TextConverter.PLAIN_TEXT_FORMAT);
                    importer.useClipboardAnnotations = this.useClipboardAnnotations;
                    importer.configuration = _config;
                    return importer.importToFlow(source);
            return null;
        public function get configuration():IConfiguration
            return _config;
        public function set configuration(value:IConfiguration):void
            _config = value;
    import flashx.textLayout.elements.ParagraphElement;
    import flashx.textLayout.elements.SpanElement;
    import flashx.textLayout.elements.ListElement;
    import flashx.textLayout.elements.ListItemElement;
    class AdditionalListExporter extends ConverterBase implements ITextExporter
        /** Constructor */
        public function AdditionalListExporter()   
            super();
        public function export(source:TextFlow, conversionType:String):Object
            if (source is TextFlow)
                source.getChildAt(source.numChildren - 1).setStyle(MERGE_TO_NEXT_ON_PASTE, false);
                var list:ListElement = new ListElement();
                var item1:ListItemElement = new ListItemElement();
                var item2:ListItemElement = new ListItemElement();
                var para1:ParagraphElement = new ParagraphElement();
                var para2:ParagraphElement = new ParagraphElement();
                var span1:SpanElement = new SpanElement();
                span1.text = "ab";
                var span2:SpanElement = new SpanElement();
                span2.text = "cd";
                list.addChild(item1);
                list.addChild(item2);
                item1.addChild(para1);
                para1.addChild(span1);
                item2.addChild(para2);
                para2.addChild(span2);
                source.addChild(list);
                var exporter:ITextExporter = TextConverter.getExporter(TextConverter.TEXT_LAYOUT_FORMAT);
                exporter.useClipboardAnnotations = this.useClipboardAnnotations;
                return exporter.export(source, conversionType);   
            return null;

  • Will Adobe ExportPDF convert a pdf with text and images to docx ?

    I have tried to convert an adobe pdf, which includes text and images, to a docx file.  The Adobe ExportPDF has not been able to do it - comes back with many errors.

    Mostly it can do it, though you can't expect a precise match on the layout. What errors do you get?

  • I ... Acrobat.... (sometimes, when I need to print PDF with text and image)

    First of all, I want to let Adobe know that you are a immens castle that is almost impossible to communicate with!
    I just want a simple question to be answered: I want to print a document which beholds text AND an image.
    If I print it, the image is NOT on the print (MacBook and iMac Yosemite)
    If I print it form my iPhone (6), the image is on the print.
    How can I fix it?

    You report your problem as using Acrobat on a Mac. You've posted in the Reader forum for iOS.
    I've moved your question to the Creating, Editing and Exporting PDF forum which seems more appropriate.
    You'll need to provide more information for us to be able to help you.

  • Div tag with text and image verticaly centered

    I am having a problem with vertically aligning an image with
    a text line in a div tag using an external CSS file.
    Any help would be appreciated

    quote:
    Originally posted by:
    Night_Ripper
    You can simply do this:
    ProdDimensions img {vertical-align:middle;}
    Or you can use an un-ordered list that has your arrow
    embedded as a background image, something like this:
    .ProductList ul {list-style-image:
    url(Arrow.gif);list-style-position:outside;list-style-type:none;text-align:left;}
    .ProductList li {margin:0;}
    wrap your unordered list around a div with the class
    ProductList (or whatever you want to call it) and it will display
    with the arrows in the middle of the text.
    Another way to do it would be to set a background image on
    ProdDimensions class like this:
    background: url(Arrow.gif) left center
    no-repeat;padding-left:21px;
    That will simply put a background image to the left middle of
    your div, the padding will ensure the text is not on top of the
    arrow.
    I used your idea of using the arrow as the div bg and it
    worked like a charm.
    Thank you very much for your help!

  • How to send an SMS with text and image

    I'm trying to add a photo and text to an SMS but can't add anything in the body of the SMS. What do I need to do?

    Hi Joe,
    Yeah, that's been the method I've been testing with. Is there a way for AIR to access the Intent API?
    Android code:
    final Intent i = new Intent(Intent.ACTION_SEND);
    i.putExtra("sms_body", msgText);
    i.putExtra(Intent.EXTRA_STREAM, imageUri);
    i.setType("*/*");
    startActivity(i);
    Thanks

  • As to apply bar of clod roller with text and image /Como aplicar barra de rolagem com texto e imagem

    Tem um componente no Flash que aplica a barra de rolagem, mas queria saber se tem uma maneira de personalizála. o componente scrollbar, apenas muda a coloração da barra, quero saber como criar uma barra de rolagem personalizada.
    It has a component in the Flash that applies the bar of clod roller, but  wanted to know if it has a way of personalizála. the component to  scrollbar, only dumb the coloration of the bar, I want to know as to  create a bar of personalized clod roller.
    Exemplo :http://www.djfilipemonteiro.com.br/?gclid=CNa4lsLes6ECFQUf7god-1x8_w

    I am modifying the correct httpd.conf file on the server, it just doesn't seem to work. - If I put the rewrite rules in the <Directory /> the rewrite works but it adds /Library/WebServer/Documents to the URL.
    I also tried putting the rewrite rules in <IfModule mod_rewrite.c> but that did not work either.
    mod_rewrite is enabled and running on the server.
    I will post the rewrite rules again in the code brackets. Sorry for the long post. - If some one can try them out on their Leopard Server to see if they can get them to work, it would be much appreciated. Again, these work on my Leopard Client but I can't get them to work on Server.
    -- The httpd.conf file posted above is just the default conf file found in /private/etc/apache2/
    <code>
    RewriteEngine On
    Options +FollowSymLinks
    RewriteRule ^(.+)/$ http://%{HTTP_HOST}$1 [R=301, L]
    RewriteCond %{THE_REQUEST} ^GET\ ([^\?]+)\.php(.*)\ HTTP
    RewriteRule (.+)\.php(.*)$ $1$2 [R, L]]
    RewriteCond %{THE_REQUEST} ^GET\ ([^\?]+)\.asp(.*)\ HTTP
    RewriteRule (.+)\.asp(.*)$ $1$2 [R, L]]
    RewriteCond %{THE_REQUEST} ^GET\ ([^\?]+)\.aspx(.*)\ HTTP
    RewriteRule (.+)\.aspx(.*)$ $1$2 [R, L]]
    RewriteCond %{THE_REQUEST} ^GET\ ([^\?]+)\.htm.(.)\ HTTP
    RewriteRule (.+)\.htm.(.)$ $1$2 [R, L]]
    RewriteCond %{THE_REQUEST} ^GET\ ([^\?]+)\.cfm(.*)\ HTTP
    RewriteRule (.+)\.cfm(.*)$ $1$2 [R, L]]
    RewriteCond %{THE_REQUEST} ^GET\ ([^\?]+)\.bak(.*)\ HTTP
    RewriteRule (.+)\.bak(.*)$ $1$2 [R, L]]
    RewriteCond %{THE_REQUEST} ^GET\ ([^\?]+)\.inc(.*)\ HTTP
    RewriteRule (.+)\.inc(.*)$ $1$2 [R, L]]
    RewriteCond %{THE_REQUEST} ^GET\ ([^\?]+)\..(.)\ HTTP
    RewriteRule (.+)\..(.)$ $1$2 [R, L]]
    <code>

  • How can i create a simple netweaver portal page that shows text and images?

    Hi,
    i have a simple question or maybe it's not so simple.
    I am completly new to SAP Netweaver 2004s Portal. At the moment i'm trying to understand the struture of the whole thing. I already know how to create roles, worksets and pages and i know how to combine the different elements so a user can acces them.
    And now i want to create a simple portal page that shows text and images. Is it possible to create such a simple page with the portal content studio? What iView do i have to use?
    (I just want to create a start page with a welcome text on it.)

    Marc
    Considering that you would any ways go ahead with complex development from this simple start page I recommend create a Web dynpro Iview for your start page (include the Iview in your page).
    For putting the contents use Netweaver Developer studio to build a simple start page application and put your static text on that Iview.
    Please go through the following log after your NWDS development is over - This will make you comfortable for further challenging work.
    http://help.sap.com/saphelp_erp2005/helpdata/en/b7/ca934257a5c96ae10000000a155106/frameset.htm
    Do reward points if this helps and let me know of you want anything more.

  • Need help with adding formatted text and images to Crystal Report?

    Here's my scenario:
    I have a customer statement that's generated as a crystal report and that has a placeholder for advertisement. The advertisement is mixture of formatted text and images. Until now we only had one advertisement that was always used on the report. The new requirement is that we would have a pool of hundreds of advertisements and would need to display one specific advertisement on the customer statement based on various marketing criteria. They key is that the advertisement content will be determined programmatically and cannot be hardcoded into the report. I'm using Crystal2008 with .net SDK.
    Here are the solutions I thought of, but I'm still rather lost and would appreciate your help/opinion.
    1) Pass HTML or RTF to the report
    Not really sure if this is possible and how to get it done. Also how would I pass in images? Would display formatting be reliable when exporting to PDF?
    2) Create each add as a subreport and append it programatically
    I actually have this working, but I only know how to append a new section to the end of the report and then load the subreport to the section. I have no other controll of the placement. Is there a way to dynamically load a subreport to a predefined section in the main report? How about adding a dummy subreport in the main report as a placeholder and then replacing it with a different subreport? How could I do this?
    3) Pass an Image to the report
    I would create each advertisement as an image and then would somehow add the image to the report. How would I load the image and control the placement? Could I somehow define a placeholder for the image in the main report-maybe a dummy image to be replaced?
    Thank you.

    Hello Pavel,
    I would got the third way.
    You can use dynamic images in your report.
    Just by changing the URL to the image the image can be changed.
    Please see the [Crystal Manual|http://help.sap.com/businessobject/product_guides/cr2008/en/xir3_cr_usergde_en.pdf] and search for images.
    or directly here
    [Setting a Dynamic Graphic Location Path on an Image Object|https://boc.sdn.sap.com/node/506]
    [Dynamic image and HTTP://|https://boc.sdn.sap.com/node/3646]
    [codesample for .NET|https://boc.sdn.sap.com/node/6000]
    Please also use
    [Crystal Reports 2008 SDK Documentation and Sample Code|https://boc.sdn.sap.com/developer/library/CR2008SDK]
    [Crystal Reports 2008 .NET SDK Tutorial Samples|https://boc.sdn.sap.com/node/6203]
    Hope this helps
    Falk

  • Resizing text and images with actions and keeping it resized for the next slides, how to?

    Hello everybody,
    I searched over the net and in this support section for a solution to my problem, but i didnt find any, so...here I am asking you experts.
    Through a particular use of different actions I make a logo "compose" in the first slide of my presentation (the logo is composed by text and images that interact), then in the second slide i make it resize so it goes 50% of its size and moves down like a TV logo, in the corner of the slide, and I want it to stay there for all the lenght of the presentation.
    It might be a stupid problem, but I didnt understand how to keep it there, 50% of its size and always in that position. If i duplicate the slide I obviously duplicate the 100%-size-logo, not its 50%-size-version, and if i shrink it in order to make it be 50% of its size the text size doesnt shrink so i have to change the text size manually, but the visual effect is imperfect.
    Lets summarize:
    slide 1: text appears, image appears, the text and the image move and "compose" the logo
    slide 2: the complete logo reduces its size to 50% and moves in the lower corner of the presentation, in the place I want it to be for, lets say, 20 slides
    slide 3: i want to have this logo already reduced in size and in its position, in the right lower corner, but if i try to group the different parts of the composed logo and i try to squeeze them the font doesnt change its size, I only squeeze the area that the text occupies.
    Some help please guys?
    Thanks in advance,
    Dom-
    (add: the problem is kind of similar to this: https://discussions.apple.com/message/9179367#9179367 . the idea of making a slide that contains the logo and text in the exact positions they would be after the move and scale actions is good and that was my first attempt, the probem is that it looks impossible to me to create a second "little" version of the logo that looks exactly the same of the first one that i reduced, so i hope there is some way to tell the app to use "the first logo, only resized the way i want", and thats the point where the problem with the size of the text comes out)

    Hi pritam,
    The “maintain proportions of window for different monitor
    resolutions” property will maintain the proportional size of the front panel
    (its x and y sizes) when opened in a different resolution. The front panel
    objects will not be resized and will appear larger (and may not fit inside the
    front panel) when saved in a higher resolution, and moved to a lower
    resolution. You can use the “Keep window proportions” property to achieve the
    same results.
    To have both the front panel dimensions and front panel
    controls scale, you need to have both the above property and the “scale all
    objects on front panel as the window resizes” selected. The labels will not be
    resized by this.
    I tried using both properties on two monitors and noticed
    that the change does not occur when the resolutions between the monitors are
    different. I had to lower both monitors’ resolution to see the change work
    properly.
    Please post back if you have any questions. Have a great day!
    Ryan D.
    District Sales Manager for Boston & Northern New England
    National Instruments

  • Stretched text and image with FULL_SCREEN_INTERACTIVE after Air player update

    One of my Air applications uses StageDisplayState.FULL_SCREEN_INTERACTIVE to switch to full screen during the presentation of some sheets.
    Everything worked fine untill some users reported a streching of texts and images in the sheets.
    It turns out that the problem occurs after an update from the Adobe Air Player to 3.1 from  2.7.
    The first screen shots shows the text as it should be, the second screen shot shows the text after the update of the Air Player.
    The code used to go into the Full Screen mode is:
        public function setFullScreenInteractive(fullScreenWidth:int = Constants.INT_SCREEN_WIDTH_SMALL, fullScreenHeight:int = Constants.INT_SCREEN_HEIGHT_SMALL):void
                             s.fullScreenSourceRect = new Rectangle(          0, 0, fullScreenWidth, fullScreenHeight);
            s.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
    with  Constants.INT_SCREEN_WIDTH_SMALL = 800 and  Constants.INT_SCREEN_HEIGHT_SMALL = 600.
    I can reproduce the problem on a couple of computers with Windows Xp but it's not happening on all the computers I've tested.
    Any idea how to fix this (without telling my users to Uninstall the current Air Player and reinstall the Air Player 2.7)?
    Regards,
    Bart

    Hi Bart,
    Unfortunately the correct screenshot link appears to broken.  Could you please open a new bug report on this over at bugbase.adobe.com?  Please post back with the URL so that others affected can add their comments and votes.  It would also help if we had a sample project/application that we can reproduce this issue with.  If you'd like to keep this private, please feel free to send it to me directly at [email protected]
    Thanks,
    Chris

  • Can anyone recommend an alternative software programme to Pages? I have an OS X 10.7.5 macbook pro, so I am unable to get it. I want a programme that I can create docs with pictures and text on, invitations, posters etc. Many thanks in advance-..

    Can anyone recommend an alternative software programme to Pages? I have an OS X 10.7.5 macbook pro, so I am unable to get it. I want a programme that I can create docs with pictures and text on, invitations, posters etc. Many thanks in advance…..

    LibreOffice

  • I´ve made four Columns with text and an Image over the middle of two columns. How do I put a text u

    I´ve made four Columns with text and an Image over the middle of two columns. How do I put a text under the Image that spans over the Columns?

    Did you mean that?
    or
    Did you mean that?
    Let me know.

  • Conditional Text and Image based on Excel column values

    Hi,
       I have an excel file which contains data that needs to be imported/merged in an InDesign document. I have converted that file into a CSV... I'm unable to figure out how to create document using Data Merge after evaluating some conditions on data ... Example InDesing document layout is like below and will be repeated for say 200 data rows...
    Heading 1
    Text 1, Text 2
    Text 3
    Image
    Heading 1, Text 1 and Text 2 even Image value will be set after checking some condition like below
    if ( column 'A' == ' ' && column 'B' == '1')
      Set 'Heading 1' == column X
    if ( column 'C' == '0' && file.exist(column C & '.jpg'))
       Set 'Image' == column C & '.jpg'
    Can someone please guide me how to create document when CSV and Images are given based on this scenario? and even if Data Merge is the right solution for this.
    -- Thanks.

    Data merge can only reproduce one layout, so you can't merge 200 rows and then change things unless you do it in separate documents and then combine them. Of course anything you can do via scripting or manually on a regular document you can also do to a merged document after the merge is complete.
    It sounds like this is a multiple-records-per-page scenario. TO do that you set up ONE instance only of what you want to merge, in the upper left position on the page. ID then duplicates EVERYTHING that is on the page as many times as will fit using the spacing parameters you provide. This means you need to be careful with frame sizes so they don't extend beyond where they should, but it also means you can add a no-fill, no-stroke frame as a border or bounding box to make it easier to get a precise size to be used by each record. Frames in merged documents are not threaded from record to record (though there are methods for doing that after the merge, if desired), so deleting a record normally leaves a hole in the page.
    If you have master page items, it's probably best to us the "none" master before the merge, then apply the correct master page after.
    Peter

  • Printing text and images together on a single page (printjob)

    Hello all,
    how am I able to print both text and images on the same page (defined by one printjob), using the javax.print API?
    It seems that one printjob (one page) can have only one flavor, that is text, or GIF, or JPEG, etc. Since the majority of print jobs out there usually require text and graphics on the same sheet this seems a bit strange.
    I have resorted on creating a PDF file through the iText library, and then printing by converting to GIF (quality is significantly reduced though, not an option), or by using the Acrobat Reader command line from java (looks dangerous for batch printing). My printer does not support printing directly using the PDF flavour.
    So, I solved the problem by converting to PDF, but printing is still cumbersome. Any other ideas?
    Thank you for your time,
    Ari.

    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've created an Automator workflow application (requires Tiger), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. It's compatible with iPhoto 08 libraries and Leopard. iPhoto does not have to be closed to run the application, just idle. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.

Maybe you are looking for