Android的 - 简单的设计
问题描述:
您好有人能帮助我如何获得一个XML DESGIN喜欢这幅画:Android的 - 简单的设计
一切都是容易的,但我只想把价格定到手机的右上角,但我不知道如何:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/white"
android:id="@+id/souscarte_element_layout">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:id="@+id/souscarte_element_title"
android:text="deddewdedwe"/>
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:id="@+id/souscarte_element_prix"
android:gravity="right"
android:text="12E"/>
</LinearLayout>
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/souscarte_element_desc"
android:text="deddewdedwe"/>
</LinearLayout>
谢谢
答
正如你已经试过我协助你完成设计。有很多方法可以做到这一点,但我只是稍微修改一下代码来完成设计
在您的代码的前2个TextView
中添加android:layout_weight
标记。根据您的需要设置值。例如设置第一个TextView
3和第二个的重量。然后在Textview
中添加一些额外的填充以使其美观。
+0
谢谢你就是我想要的..大声笑坏trololo,在Android设计是很挑剔.. – eento 2013-03-19 14:30:46
您是指不同文本区域的布局,还是您在寻找应用边框的帮助? – Rawkode 2013-03-15 16:03:40
你必须至少付出努力。我们不会为您编写代码。包括你已经尝试过的一些XML ... – 2013-03-15 16:06:32