我想要两个按钮“运行”和“结果”并排。但是我没有太多的运气。XML - 如何并排获取两个按钮?
我已经尝试使用RelativeLayout
,并且还将layout_weight
添加到两个按钮,但他们似乎只是消失,地图接管屏幕。
任何人都可以指出我做错了什么,可以做些什么来解决它?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/myLocationText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello" />
<TextView
android:id="@+id/resultsHomeTest"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="" />
<Button
android:id="@+id/btnRun"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Run" />
<Button
android:id="@+id/btnResults"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Results" />
<TextView
android:id="@+id/resultsTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textAppearance="?android:attr/textAppearanceMedium" />
<com.google.android.maps.MapView
android:id="@+id/myMapView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:enabled="true"
android:clickable="true"
android:apiKey="02kgJwy0ijcQsVCaCzD9sFv69dOi4gXBEUjIbuQ"
/>
<!--
Desktop key: 02kgJwy0ijcTK7fd-wxv7OsPUFEveXTUt16lrRA
Laptop key : 02kgJwy0ijcQsVCaCzD9sFv69dOi4gXBEUjIbuQ
-->
</LinearLayout>
@csmit机器人:方向=“横向”是默认 – Blackbelt 2012-08-01 16:01:09
啊非常感谢你 – MurphyApps 2012-08-01 16:01:52
时fixs您的问题的答案,你应该接受它。 – Blackbelt 2012-08-01 16:02:35