android用户界面的规则

android用户界面的规则,android,android-layout,android-widget,Android,Android Layout,Android Widget,我的android用户界面有问题。我的钮扣不对。即使我的按钮向右对齐,但仍然无法正确对齐 我想知道是否有任何文档可以解释如何正确地布局事物,以及小部件在tablerow中时的行为?或者换句话说,层次结构如何影响事物对齐的方式?? 谢谢 使用RelativeLayout而不是线性布局可能会更幸运 例如,您可以像这样对齐图像视图和按钮: <RelativeLayout android:layout_width="match_parent" android:layout_he

我的android用户界面有问题。我的钮扣不对。即使我的按钮向右对齐,但仍然无法正确对齐

我想知道是否有任何文档可以解释如何正确地布局事物,以及小部件在tablerow中时的行为?或者换句话说,层次结构如何影响事物对齐的方式?? 谢谢


使用
RelativeLayout
而不是
线性布局可能会更幸运

例如,您可以像这样对齐
图像视图
按钮

<RelativeLayout 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content">

    <ImageView 
        android:layout_height="60dip"
        android:layout_width="60dip" 
        android:layout_alignParentLeft="true"/>

    <Button 
        android:text="Button" 
        android:layout_alignParentRight="true" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content"/>

</RelativeLayout>


要了解可能的情况,请使用
RelativeLayout
上的入门文档和。

您可能会更幸运地使用
RelativeLayout
而不是
线性布局

例如,您可以像这样对齐
图像视图
按钮

<RelativeLayout 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content">

    <ImageView 
        android:layout_height="60dip"
        android:layout_width="60dip" 
        android:layout_alignParentLeft="true"/>

    <Button 
        android:text="Button" 
        android:layout_alignParentRight="true" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content"/>

</RelativeLayout>


为了了解可能发生的事情,
RelativeLayout
上的入门文档是和。

为什么不看看SDK附带的API演示?你能发布一个屏幕截图来说明你遇到的问题吗?为什么不看看SDK附带的API演示?你能发布一个屏幕截图来说明你遇到的问题吗?这并不能解决我的问题问题我还有很多小部件需要添加到此屏幕。这就是为什么我在寻找某种文档,它会告诉我编码时要遵循的规则:)这就是为什么我将您链接到两个android开发文档页面,其中有关于RelativeLayout的提示。除了我发布的一个例子之外,这些将给你提供其他使用RelativeLayout的例子。如果你是android布局新手,我强烈建议你在上查看Hello,Views教程。这并不能解决我的问题。。我还有很多小部件需要添加到此屏幕。这就是为什么我在寻找某种文档,它会告诉我编码时要遵循的规则:)这就是为什么我将您链接到两个android开发文档页面,其中有关于RelativeLayout的提示。除了我发布的一个例子之外,这些将给你提供其他使用RelativeLayout的例子。如果你是android版面的新手,我强烈建议你在上查看Hello,Views教程。