一些随机的android开发问题

时间:2010-12-07 00:51:07

标签: android scrollview android-linearlayout

嘿大家,我不想单独制作主题,所以我决定把所有问题都放到一个主题中。如果你不能马上回答所有问题,那也没关系,但如果你能回答其中一个问题就会有所帮助。

1。)在我的表格布局中,我有3个水平相邻的按钮。只有第三个按钮的一半显示。不应该eclipse自动重新调整所有三个大小,以使它们适合任何屏幕正在查看应用程序?有没有办法自动重新调整大小以适应每个屏幕? - ScrollView,TableLayout和Buttons的高度和宽度都设置为wrap_content

2。)点击它们有没有办法让链接改变颜色?有点像CSS中的'A:visited'或'A:hover'。因为现在,我的一个XML文件中有[code] android:autoLink =“web”[/ code]。链接是蓝色的,但是在看到弹出窗口之前不知道你是否点击它是相当恼人的。我敢肯定有一些我可以使用的javascript但是我希望它在用户点击后退按钮后返回正常颜色...这样如果他们想再次点击它仍然会改变颜色。

3.。)如何在ImageView中嵌入链接?

4.。)如果我使用LinearLayout并将方向设置为带有背景图像的垂直方向,则屏幕的右侧和最底部会有一个黑色空间。图像不会填满该部分。我怎么能让它填满?

2 个答案:

答案 0 :(得分:0)

1。)如果设置为wrap_content,为什么要根据屏幕调整大小?此外,eclipse没有做任何事情,它只是一个IDE。

答案 1 :(得分:0)

回答: 1.可以使用linearlayouts(垂直/水平方向)和设置android:layout_weight属性的组合轻松完成 3.尝试使用Framelayout或Relativelayout显示Imageview及其上方设置包含链接的textview。 像这样:

<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请您详细说明。

相关问题