PTT
Submit
Submit
选择语言
正體中文
简体中文
PTT
AndroidDev
[问题] linearlayout的问题
楼主:
a43149
(台湾真是个宝岛... 屁!)
2016-05-17 16:15:58
下面是我的layout程式码
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<Button
android:id="@+id/mybut"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAllCaps="false"
android:text="@string/button"/>
<TextView
android:id="@+id/mytext"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/text"/>
</LinearLayout>
<Button
android:id="@+id/mybut1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAllCaps="false"
android:text="@string/button1"/>
<TextView
android:id="@+id/mytext1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:text="@string/text"/>
</LinearLayout>
我想要让我的textview1显示在我的button1的旁边
可是我这样弄怎么只有显示出button1而已 其他的都没有出现
有人可以帮我看看吗? 谢谢!!
作者:
LZN
(秋)
2016-05-17 16:24:00
要不要先说明哪一个是textview1哪一个是button1?
作者:
king5201
(我 要 ..)
2016-05-17 17:26:00
你的layout只会出现mybut跟mytext这两个吧...调整一下里面LinearLayout layout_height试试?
作者: FlowerYen (Greg)
2016-05-17 17:44:00
你采用了 horizontal的linear来包你的textview跟button为了要实现"textview1显示在我的button1的旁边"但是你的mytext的width=match_parent 所以mybut消失了解法:使用layout_weight,或者是relative layout
继续阅读
[问题] 请教两个问题1.upload data 2.viewpager
freedom74569
[问题] Webview侦测html id
james73510
[问题] 如何在手机内部存TXT档?
puppyulove
[问题] android studio 字形求救
apout
[问题] 请问有人刷过Zenfone 6吗
howard861025
[问题] Android Studio视窗显示超出可视范围
dharma
[问题] QR code 连续扫描的问题
puppyulove
[问题] webview如何取得/自动输入使用者资料
tommy91634
[问题] 把平板当作开发版的外接触控萤幕?
ChinaSuckMyD
[问题] Android Studio ndk-build 参数说明/出处
Avatar123
Links
booklink
Contact Us: admin [ a t ] ucptt.com