1. Download our Official Android App: Forums for Android!

Absolute Beginner Android Studio Codelabs

Discussion in 'Android Development' started by Billaboard, Dec 6, 2018.

  1. Billaboard

    Billaboard Lurker
    Thread Starter
    Rank:
    None
    Points:
    6
    Posts:
    7
    Joined:
    Nov 25, 2018

    Nov 25, 2018
    7
    1
    6
    I am still struggling with the very first Codelabs session, I'm afraid.

    There is an instruction relating to a very simple TextView that states:
    1. Set the textStyle to B (bold) and the textAlignment to ALIGNCENTER (center the paragraph)
    But I can find nowhere to set textAlignment to anything.

    If I center the text by using "gravity". the Design graphic centers the text, but the Blueprint graphic has the text left justified.

    Is this right, or am I missing something obvious?

    The app does appear to work, though. but I would like to understand what is going on.
     

    Advertisement

  2. LV426

    LV426 I say we take off and nuke this place from orbit
    Moderator
    Rank:
     #11
    Points:
    1,988
    Posts:
    7,879
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    7,879
    11,525
    1,988
    Male
    Software developer
    South West of England
    So did you click on the link to view all attributes, including textAlignment, as explained in your previous thread here?

    It's the link at the bottom of this screen. Clicking that will show all available attributes for the UI component you selected.


    attributes.png
     
    GameTheory likes this.
  3. Billaboard

    Billaboard Lurker
    Thread Starter
    Rank:
    None
    Points:
    6
    Posts:
    7
    Joined:
    Nov 25, 2018

    Nov 25, 2018
    7
    1
    6
    Well, yes. I've spent ages looking through all the attributes over several passes and installation on a couple of machines. Using version 3.2.1 of the program.

    At the top of "All Attributes", there are text, textColor, textSize and textStyle. Then, in the alphabetical list below, there are textAllCaps, then textColorHighlight and others further along the alphabet, but no textAlignment.

    The course illustration shows a set of selectable graphics as the alignment selector, but I can't see this either.

    The gravity setting seems to do the job, but there is this weird thing where the two displays show the text in different places.
     
  4. LV426

    LV426 I say we take off and nuke this place from orbit
    Moderator
    Rank:
     #11
    Points:
    1,988
    Posts:
    7,879
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    7,879
    11,525
    1,988
    Male
    Software developer
    South West of England
    Here's a screenshot of my Attribute view for TextView.
    Post a screenshot of what you see.


    atrributes_textview.png
     
  5. Billaboard

    Billaboard Lurker
    Thread Starter
    Rank:
    None
    Points:
    6
    Posts:
    7
    Joined:
    Nov 25, 2018

    Nov 25, 2018
    7
    1
    6
    Here is what I see. First, the upper, presumably list of Attributes for textView, then the lower alphabetical list. I'll also post a shot of the displaced text

    . AS1.jpg AS2.JPG

    AS3.JPG
     
  6. LV426

    LV426 I say we take off and nuke this place from orbit
    Moderator
    Rank:
     #11
    Points:
    1,988
    Posts:
    7,879
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    7,879
    11,525
    1,988
    Male
    Software developer
    South West of England
  7. Billaboard

    Billaboard Lurker
    Thread Starter
    Rank:
    None
    Points:
    6
    Posts:
    7
    Joined:
    Nov 25, 2018

    Nov 25, 2018
    7
    1
    6
    Many thanks for that. It now works fine and the two images have also come into sync. It does seem odd that some people have the problem and others don't, but I presume this is an expected "feature" of beta software.

    I must make some effort to find my way around StackOverflow.

    Thanks again for the help.
     

Share This Page

Loading...