Xamarin Android |布局样式 [英] Xamarin Android | Layout style

查看:97
本文介绍了Xamarin Android |布局样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建这种布局样式,但是我仍然不知道该怎么做? 有人可以帮助我吗?

I am trying to create this layout style but still I have no idea how to do it? is there anybody who can help me ?

我需要主布局,并且在布局中必须在左侧的图像视图中显示颜色,然后将其显示为Title,并带有填充说明,在右侧必须为img.

I need main layout and in the layout must be on the left image view for color next will be Title with description for fill parrent and on the right side must be img.

推荐答案

在这里.我为您设计了左标志,标题和描述标签,以及右图像视图控件.只需创建一个新的.axml文件并使用以下代码即可:

Here you go. I designed you left flag, title and description labels plus right image view control. Just create new .axml file and use this code:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_height="wrap_content"
    android:layout_width="match_parent">
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/linear"
        android:orientation="vertical"
        android:layout_alignParentTop="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true">
        <TextView
            android:id="@+id/titleTextView"
            android:layout_width="wrap_content"
            android:layout_height="40dp"
            android:layout_alignParentLeft="true"
            android:layout_centerVertical="true"
            android:layout_marginLeft="25dp"
            android:gravity="center_vertical"
            android:paddingTop="5dp"
            android:text="Title"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:textSize="30dp" />
        <RelativeLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true" >
            <TextView
                android:id="@+id/descriptionTextView"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentLeft="true"
                android:layout_marginLeft="25dp"
                android:height="30dp"
                android:text="Description"
                android:textAppearance="?android:attr/textAppearanceMedium" />
        </RelativeLayout>
    </LinearLayout>
    <RelativeLayout
        android:id="@+id/flagLayout"
        android:layout_width="15dp"
        android:layout_height="70dp"
        android:background="#5416B4"
        android:layout_alignParentLeft="true" />
    <RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">
        <ImageView
            android:id="@+id/imageView"
            android:layout_width="90dp"
            android:layout_height="70dp"
            android:layout_alignParentRight="true"
            android:background="#ffa500" />
    </RelativeLayout>
</RelativeLayout>

最终结果如下:

这篇关于Xamarin Android |布局样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆