【发布时间】:2017-06-30 12:04:18
【问题描述】:
我有以下布局。我需要的是左手角的文本框,稍后我将插入一个计数器以显示地图将在几秒钟后刷新。
<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" >
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:map="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/map"
tools:context="com.example.ns.appversion1.MapActivityFragment1"
android:name="com.google.android.gms.maps.SupportMapFragment"/>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="96dip"
android:orientation="vertical"
android:weightSum="2" >
<TextView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="left"
android:background="@drawable/border"
android:text="Refreshing 1"
android:textColor="#000"
android:textSize="12sp" />
</LinearLayout>
</FrameLayout>
</RelativeLayout>
这里是border.xml。现在的问题是,我只希望边框围绕单词,但在这里它与整个顶部区域接壤。我想限制在字里行间。
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<stroke
android:width="2dp"
android:color="#0288D1" />
</shape>
【问题讨论】:
-
“我只想让边框围绕单词”是什么意思?您将其应用于 textView 而不是单词
-
我想要这个词。但是当我将它应用到整个文本视图时,它看起来很丑
-
然后扭曲视图或发布预期的输出
-
我不明白你所说的扭曲视图是什么意思?
-
你能附上一张你拥有什么以及你想要实现什么的图片吗?这样人们才能更好地帮助你