<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center" android:background="@drawable/robo">
<TextView android:id="@+id/TextView02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Max Time(Sec)">
</TextView>
<EditText android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="100"
android:id="@+id/maximum"
android:inputType="number">
</EditText>
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Start"
android:id="@+id/startbtn"
android:focusable="true">
</Button>
<ImageButton android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:src="@drawable/icon"
android:id="@+id/imageButton1">
</ImageButton>
</LinearLayout>
答案 0 :(得分:0)
位置取决于它的父容器/组件(布局)的位置以及它的layout_ *属性。 而且你没告诉你想要什么。如果你想改变它的位置 - 用布局中的另一个视图切换它。
答案 1 :(得分:0)
在布局中放置更多按钮,并根据您的需要隐藏或显示它们
答案 2 :(得分:0)
在LinearLayout中,您无法更改位置 - 因为布局是线性的(顺序)。但是你可以使用layout_margin来稍微移动小部件。
我不知道你想做什么,但是你应该看看FrameLayout(它可以让你把图像放在任何地方!)。我个人最喜欢的是RelativeLayout。
答案 3 :(得分:0)
视图处于关系中,不仅在RelativeLayout中,而且在Others中,因此您应该选择描述应用程序布局的最佳方式,使用多个常用的方法。 要改变标签的位置,你最好使用AbsoluteLayout然后使用android:layout_x =“”,android:layout_y =“”
答案 4 :(得分:0)
你的具体要求是什么? 你可以放两个按钮,使一个可见,另一个看不见或反之亦然。你可以将layout_margin放到所有方向。并尝试将所有组件放在不同的布局中。