我目前正在尝试创建一个列表视图,它将显示关于帖子的详细信息。为此,我创建了用于设计列表项目的xml文件。设计布局android
这是最后一眼我要为我的活动。到目前为止,我已经成功地处理了圆角,图像按钮和文本,但我尝试了一段时间来处理文本框的左侧。我希望它有一个尖锐的提示。但我仍然无法处理它。
我将添加xml文件来显示我做了什么。
**This is the xml file for the list item**
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="300dp"
android:layout_height="160dp">
<LinearLayout android:id="@+id/desclayout"
android:layout_width="240dp"
android:layout_height="140dp"
android:background="@drawable/layout_my_posts_selector"
android:layout_marginRight="5dp">
<TextView
android:id="@+id/myPostDescription"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="left"
android:maxLength="120"
android:hint="@string/description"
android:inputType="textMultiLine"
android:lines="4"
android:maxLines="5"
android:paddingBottom="8dp"
android:textColorHint="#f7941e"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="8dp"
android:textColor="#6d6e71"
android:scrollbars="vertical"
android:textSize="14sp">
</TextView>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_toRightOf="@+id/desclayout"
android:background="@drawable/description_layout_my_posts_selector"
android:orientation="vertical"
android:paddingLeft="7dp"
android:layout_height="140dp">
<ImageButton
android:id="@+id/acceptMyPostBtn"
android:layout_width="40dp"
android:background="@drawable/my_posts_button_selector"
android:layout_marginTop="5dp"
android:layout_height="40dp"
android:src="@drawable/v"/>
<ImageButton
android:id="@+id/closeMyPostBtn"
android:layout_width="40dp"
android:background="@drawable/my_posts_button_selector"
android:layout_below="@id/acceptMyPostBtn"
android:layout_height="40dp"
android:layout_marginTop="5dp"
android:src="@drawable/x"/>
<ImageButton
android:id="@+id/showOnMapMyPost"
android:layout_width="40dp"
android:src="@drawable/location"
android:background="@drawable/my_posts_button_selector"
android:layout_marginTop="5dp"
android:layout_height="40dp"/>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_below="@+id/desclayout"
android:paddingLeft="6dp"
android:background="#2d2d2d"
android:layout_height="20dp">
<TextView
android:layout_width="fill_parent"
android:textColor="@android:color/background_light"
android:text="Finished at 19/01/2013 13:55"
android:layout_height="fill_parent" />
</LinearLayout>
</RelativeLayout>
layout_my_posts_selector
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#f1f1f2"/>
<stroke android:width="3dp" android:color="#2d2d2d" />
<corners android:topLeftRadius="7dp" android:bottomLeftRadius="7dp"/>
<padding android:left="0dp" android:top="0dp" android:right="0dp" android:bottom="0dp" />
</shape>
description_layout_my_posts_selector
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#e7e8ea"/>
<stroke android:width="3dp" android:color="#2d2d2d" />
<corners android:topRightRadius="7dp" android:bottomRightRadius="7dp"/>
<padding android:left="0dp" android:top="0dp" android:right="0dp" android:bottom="0dp" />
</shape>
这就是它现在的样子
如果你可以请指导我如何处理锋利的提示,我会感激!
由于提前, 伊甸园
你的答案是确定的,但你应该给一个理由,为什么不在XML或编程水平,不得不提到的任何可能性是存在与否。 – Boopathi
如果您准备好编码,一切皆有可能。 我向你展示了实现它的最简单方法。 检查[this](https://github.com/madhur/android-chat-starter)项目。 –