繁体   English   中英

如何在android studio中创建ui?

[英]How can I create ui like that in android studio?

尊敬的Android开发人员:大家好,我希望大家周末愉快。我正在开发cv Android应用程序。

像下面的ui

在实现我的UI屏幕截图的XML布局下面

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">

            <ImageView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginRight="250dp"
                android:src="@drawable/education_information" />


            <TextView
                android:id="@+id/education_info"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:text="@string/education_info" />

        </LinearLayout>

        <TextView
            android:id="@+id/duration"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:text="@string/text_duration" />


        <TextView
            android:id="@+id/institution"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:text="@string/text_institution"
            android:textSize="16sp"
            android:textStyle="bold" />


        <TextView
            android:id="@+id/degree"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="16dp"
            android:layout_marginTop="20dp"
            android:gravity="center"
            android:text="@string/text_degree"
            android:textSize="16sp" />

    </LinearLayout>

在我的真实设备截图下方 更新截图

 *layout  for first image.*


<?xml version="1.0" encoding="utf-8"?>
     <LinearLayout
      android:orientation="vertical"
      xmlns:android="http://schemas.android.com/apk/res/android" 
      android:layout_width="match_parent"
      android:layout_height="120dp"
      android:background="@color/black_heading">


    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">

        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/checkbox_selector"
            android:layout_gravity="center"
            />

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:text="Education"
            android:textColor="@color/white"
            android:textSize="20sp" />

    </LinearLayout>

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:text="Education"
        android:textColor="@color/white"
        android:layout_marginStart="12dp"
        android:textSize="14sp" />
    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:text="Education"
        android:layout_marginStart="12dp"
        android:textColor="@color/white"
        android:textSize="10sp" />
    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:text="Education"
        android:textColor="@color/white"
        android:layout_marginStart="12dp"
        android:textSize="10sp" />


       </LinearLayout>

  **Layout for second image**
         <?xml version="1.0" encoding="utf-8"?>
      <LinearLayout
    android:orientation="vertical"
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/white">

    <Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/black_heading">
    </Toolbar>

    <TextView
        android:layout_marginTop="40dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="jhdfjkhjwqhfjhwqjfhwjqf"
        android:layout_gravity="center"
        android:gravity="center"
        />
    <TextView
        android:layout_marginTop="70dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="jhdfjkhjwqhfjhwqjfhwjqf"
        android:layout_gravity="center"
        android:gravity="center"
        />
    <TextView
        android:layout_marginTop="@dimen/_50sdp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="jhdfjkhjwqhfjhwqjfhwjqf"
        android:layout_gravity="center"
        android:gravity="center"
        />
    </LinearLayout>

  inside on create view in your activity

    Toolbar toolbar = findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    toolbar.setTitle("Litabswait Task");

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM