2010-12-07 43 views
-1

嘿大家,我不想單獨做一個主題,所以我決定把我所有的問題放到一個主題中。如果你不能一次全部回答它們,這很好,但如果你能回答其中的一個,這將是有幫助的。幾個隨機的Android開發問題

1.)在我的表格佈局中,我有3個按鈕水平相鄰。只有第三個按鈕的一半顯示。不應該自動重新調整大小以使它們適合任何屏幕查看應用程序?有沒有辦法自動調整大小以適應每個屏幕? - ScrollView,TableLayout和Buttons的高度和寬度都設置爲wrap_content

2.)有沒有辦法讓鏈接在點擊時變色?有點像CSS中的'A:visited'或'A:hover'。因爲現在,我在我的一個XML文件中有[code] android:autoLink =「web」[/ code]。該鏈接是藍色的,但是不知道您是否點擊了該鏈接,直到彈出窗口出現爲止。我確定有一些JavaScript可以使用,但是我希望一旦用戶點擊後退按鈕,它就會返回到正常顏色......如果他們想再次點擊它,它仍然會改變顏色。

3.)你如何在ImageView中嵌入鏈接?

4.)如果我使用LinearLayout並將背景圖像的方向設置爲Vertical,則右側和底部會有一個黑色空間。圖像沒有填充該部分。我怎樣才能把它填滿?

+7

單獨打開單獨的SO問題......好,問題更好。 – Kos 2010-12-07 00:52:47

回答

0

1)如果設置爲wrap_content,爲什麼要根據屏幕調整大小?另外,eclipse不會做任何事情,它只是一個IDE。

+0

我試過fill_parent,它仍然不起作用。我只是希望按鈕的水平尺寸相同,而不會切斷按鈕 – MJ93 2010-12-07 01:10:08

0

數目:layout_weight屬性使用的FrameLayout或RelativeLayout的用於示出ImageView的和它上面設置含有鏈接您的TextView 3.嘗試: 1.可以容易地使用(垂直/水平方向)linearlayouts的組合和設置機器人完成。 事情是這樣的:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    tools:context=".MainActivity" > 

    <ImageView 
     android:id="@+id/imageView1" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_alignParentLeft="true" 
     android:layout_alignParentTop="true" 
     android:src="@drawable/android_4" /> 

    <TextView 
     android:id="@+id/textView1" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_alignBottom="@+id/imageView1"   
     android:text="Medium Text" 
     android:gravity="center" 
     android:textAppearance="?android:attr/textAppearanceMedium" /> 

    </RelativeLayout> 

無法理解你的問題4,你可以請詳細說明了。