• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps A few different questions

Vitality93

Newbie
Nov 6, 2010
14
1
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:
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?
 
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:
<Button 
        android:text="@string/calctotal" 
	android:id="@+id/btnTotal" 
	android:layout_width="150dip" 
	android:layout_height="wrap_content">
</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.
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones