meiyourenaaa 2010-10-30 18:40
浏览 290
已采纳

只显示控件一部分

main.xml
[code="java"]
<?xml version="1.0" encoding="utf-8"?>
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
android:id="@+id/passwordlab"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:text="@string/passwordlab"
/>
android:id="@+id/password"
android:layout_width="150px"
android:layout_height="50px"
android:layout_toRightOf="@id/passwordlab"
android:layout_marginRight="50px"
android:layout_alignTop="@id/password"
/>

xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
android:id="@+id/usernamelab"
android:text="@string/usernamelab"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
android:id="@+id/username"
android:layout_width="150px"
android:layout_height="30px"
android:layout_toRightOf="@id/usernamelab"
android:layout_alignTop="@id/usernamelab"
android:layout_marginRight="20px"
/>

</RelativeLayout>
    <Button
 android:layout_width="fill_parent"
 android:layout_height="wrap_content"
 android:text="@string/set"
 android:id="@+id/setbutton"
/>

[/code]
string.xml
[code="java"]
<?xml version="1.0" encoding="utf-8"?>

SharedPreference
用戶名
密碼
保存按鈕

[/code]
显示效果如下图:

  • 写回答

1条回答 默认 最新

  • andyzhchy99 2010-11-02 12:01
    关注

    android:id="@+id/passwordlab"
    android:layout_width="wrap_content"
    android:layout_height="fill_parent"
    android:text="@string/passwordlab"
    />

    找到这个地方,你的height设置成了fill_parent能不只显示上面的才奇怪了,(*^__^*) 嘻嘻……

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog