构建Android用户界面修改

时间:2013-10-30 08:31:33

标签: android user-interface building

我是Android的新手。这对我来说是新的。我尝试了很多修改我的用户界面但我无法帮助修复我的用户界面显示了我做过努力的image.my代码。我希望任何一个帮我解决我的问题............................................ ....................

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:a="http://schemas.android.com/apk/res/android"
a:layout_width="match_parent"
a:layout_height="match_parent">
<RelativeLayout
    a:id="@+id/buttonsLayout"
    a:layout_alignParentBottom="true"
    a:layout_width="wrap_content"
    a:layout_height="wrap_content"
    a:layout_centerInParent="true">
    <Button
        a:text="^"
        a:id="@+id/up"
        a:layout_height="wrap_content"
        a:layout_width="wrap_content"
        a:layout_alignParentTop="true"
        a:layout_centerHorizontal="true" />
    <Button
        a:text="&lt;"
        a:id="@+id/left"
        a:layout_height="wrap_content"
        a:layout_width="wrap_content"
        a:layout_toLeftOf="@+id/center"
        a:layout_centerVertical="true" />
    <Button
        a:text="0"
        a:id="@+id/center"
        a:layout_height="wrap_content"
        a:layout_width="wrap_content"
        a:layout_below="@+id/up"
        a:layout_centerHorizontal="true"
        a:layout_centerVertical="true" />
    <Button
        a:text="&gt;"
        a:id="@+id/right"
        a:layout_height="wrap_content"
        a:layout_width="wrap_content"
        a:layout_toRightOf="@+id/center"
        a:layout_centerVertical="true" />
    <Button
        a:text="v"
        a:id="@+id/down"
        a:layout_height="wrap_content"
        a:layout_width="wrap_content"
        a:layout_below="@+id/center"
        a:layout_centerHorizontal="true" />
</RelativeLayout>
<ImageView
    a:src="@android:drawable/ic_menu_gallery"
    a:layout_width="match_parent"
    a:layout_height="match_parent"
    a:layout_alignParentTop="true"
    a:layout_above="@+id/buttonsLayout"
    a:id="@+id/imageView1" />
</RelativeLayout>

我希望我的用户界面看到链接

enter image description here

1 个答案:

答案 0 :(得分:0)

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
          android:orientation="vertical"
          android:layout_width="match_parent"
          android:layout_height="match_parent">

<LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
    <TextView
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:text="192.168.0.500"
            android:id="@+id/textView" android:layout_weight="1"  
            android:layout_marginLeft="15dp"/>
    <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Stream"
            android:id="@+id/button"/>
</LinearLayout>
<ImageView
        android:layout_width="match_parent"
        android:layout_height="250dp"
        android:id="@+id/imageView" android:background="@drawable/ic_launcher"/>
<LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
    <RadioButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="New RadioButton1"
            android:id="@+id/radioButton"/>
    <RadioButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="New RadioButton2"
            android:id="@+id/radioButton2"/>
</LinearLayout>
<LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content" android:gravity="center">
    <Button
            android:layout_width="100dp"
            android:layout_height="wrap_content"
            android:text="Up"
            android:id="@+id/button2"/>
</LinearLayout>
<RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
    <Button
            android:layout_width="100dp"
            android:layout_height="wrap_content"
            android:text="left"
            android:id="@+id/button3"
            android:layout_toLeftOf="@+id/buttonCenter"/>
    <Button
            android:layout_width="100dp"
            android:layout_height="wrap_content"
            android:text="center"
            android:id="@+id/buttonCenter"
            android:layout_centerHorizontal="true"/>
    <Button
            android:layout_width="100dp"
            android:layout_height="wrap_content"
            android:text="right"
            android:id="@+id/button5"
            android:layout_toRightOf="@+id/buttonCenter"/>
</RelativeLayout>
<LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content" android:gravity="center">
    <Button
            android:layout_width="100dp"
            android:layout_height="wrap_content"
            android:text="Down"
            android:id="@+id/button4"/>
</LinearLayout>

只需在ImageView中用你的图像替换图像。