在android中,如何在不增加linearlayout宽度的情况下为linearlayout内部的图像添加填充
我正在我的android xml文件中设计这个布局 我把2个线性布局1的标题和其他的身体。到目前为止一切都很好。在标题行布局中,我添加了背景图像,效果非常好 现在,当我为搜索和信息添加最右边的图像按钮时,我希望它们完全如上图所示在标题线性布局中浮动。但问题是,如果我把它们放在标题行布局中,那么标题行布局的宽度会增加,并且两者都位于标题布局之下。我有没有办法做到这一点 谢谢尝试以下组合:在android中,如何在不增加linearlayout宽度的情况下为linearlayout内部的图像添加填充,android,android-layout,Android,Android Layout,我正在我的android xml文件中设计这个布局 我把2个线性布局1的标题和其他的身体。到目前为止一切都很好。在标题行布局中,我添加了背景图像,效果非常好 现在,当我为搜索和信息添加最右边的图像按钮时,我希望它们完全如上图所示在标题线性布局中浮动。但问题是,如果我把它们放在标题行布局中,那么标题行布局的宽度会增加,并且两者都位于标题布局之下。我有没有办法做到这一点 谢谢尝试以下组合: <AbsoluteLayout android:id="@+id/widget68"
<AbsoluteLayout
android:id="@+id/widget68"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
>
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="40px"
android:layout_y="35px"
>
<ImageView
android:src = "@drawable/androidlogo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<Button
android:layout_width="124px"
android:layout_height="wrap_content"
android:text="Print Picture"
/>
</FrameLayout>
</AbsoluteLayout>
要获得此信息:
您也可以通过填充来移动图片(本例中为按钮)