use*_*454 1 android imageview android-linearlayout
这就是我要的:
[截屏]
这是我所做的:
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="30dip"
android:background="@color/color"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="1dp"
android:background="@color/color"
android:orientation="horizontal">
<View
android:id="@+id/divider"
android:layout_width="5dp"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:background="@color/grey"
android:gravity="center_vertical" />
<LinearLayout
android:id="@+id/llayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color"
android:orientation="vertical" >
<TextView
android:id="@+id/label"
style="@style/some_style"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginLeft="8dp"
android:gravity="left" />
<TextView
android:id="@+id/label2"
style="@style/some_style"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_marginLeft="8dp"
android:gravity="left" />
</LinearLayout>
</LinearLayout>
</merge>
Run Code Online (Sandbox Code Playgroud)
我已经完成了,但问题是如何在垂直线性布局的右上角对齐图像(可以在屏幕截图中看到)。
我也尝试过使用相对布局,图像出现在右上角,但它在文本视图中剪切了我的文本。
请建议:
放置在LinearLayut另一个中RelativeLayout,其中包含您的ImageView和应用于ImageView属性android:layout_alignParentRight="true"
| 归档时间: |
|
| 查看次数: |
5550 次 |
| 最近记录: |