1. Check out our companion app, Forums for Android! Download from Google Play

A few different questions

Discussion in 'Application Development' started by Vitality93, Dec 5, 2010.

  1. Vitality93

    Vitality93 Member
    Thread Starter

    Nov 6, 2010
    Hey everyone, I didn't want to make separate topics so I decided to put all my questions into 1 topic. It's okay if you can't answer them all at once but it would be helpful if you could answer even one of them.

    1.) In my table layout I have 3 buttons horizontally next to each other. Only half of the 3rd button shows. Shouldn't eclipse automatically re-size all three to make them fit whatever screen is viewing the app? Is there a way to automatically re-size them to fit each screen?
    --The ScrollView, TableLayout, and Buttons all have height and width set to wrap_content

    2.) Is there a way to make links change color when you click them? Sort of like 'A:visited' or 'A:hover' in CSS. Because right now, I have
    Code (Text):
    1. android:autoLink="web"
    in one of my XML files. The link is blue, but it is rather annoying not knowing if you clicked it or not until a popup appears. I'm sure there is some javascript that I can use however I would like for it to return back to a normal color once the user hits the back button... that way if they want to click it again it will still change colors.

    3.) How do you embed a link inside an ImageView?


  2. sajarvis

    sajarvis New Member

    Dec 6, 2010
    Marquette, MI
    Off the top of my head I can help with the first issue. You'll get much more universal results if you set sizes with "sp" for text and "dip" for basically everything else. Here's an example of a button I had in a table layout:

    Code (Text):
    1. <Button
    2.         android:text="@string/calctotal"
    3.     android:id="@+id/btnTotal"
    4.     android:layout_width="150dip"
    5.     android:layout_height="wrap_content">
    6. </Button>
    The "sp" and "dip" are pixel density values rather than absolute values, so if you choose the size you want relative to the screen it stays pretty consistent between devices.

Share This Page