English 中文(简体)
是否有可能在甲状腺中形成一种观点?
原标题:Is it possible to place one view over another in android?

我们能够对另一个大观点提出小的看法? 例如,我有录像,正在背景中查阅文件。 在这方面,在中间角,我想再发表《形象评论》。

但是,在“线性/轨道性接触”中,只能相互对等或相互对等,反之亦然。 因此,我做了些什么?

最佳回答

<代码>FrameLayouts,请您在下文中阐述每一观点。 也可通过<代码>RelativeLayout实现。

问题回答

Just in case if you want to place a view on top of a ButtonView then use this; android:elevation="7dp" for the view which needs to be placed on top of the button.

也可以通过使用https://developer.android.com/training/constraint-layout/index.html” rel=“noretinger”>ConstraintLayout 。 go角新布局。

制约因素 排斥使你能够创造大而复杂的布局,形成一种统一的观点等级(没有排他性的观点组)。

 <?xml version="1.0" encoding="utf-8"?>
  <android.support.constraint.ConstraintLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  xmlns:tools="http://schemas.android.com/tools"
  android:id="@+id/container"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="vertical"
  android:layout_weight="4"
  tools:context="com.edalat.example.MainActivity">
  <VideoView
    android:id="@+id/videoView"
    android:layout_width="283dp"
    android:layout_height="349dp"
    app:layout_constraintBottom_toBottomOf="parent"
    android:layout_marginBottom="24dp"
    app:layout_constraintTop_toTopOf="parent"
    android:layout_marginTop="24dp"
    android:layout_marginRight="24dp"
    app:layout_constraintRight_toRightOf="parent"
    android:layout_marginLeft="24dp"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintHorizontal_bias="0.509"/>
  <ImageView
     android:id="@+id/imageView"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     app:srcCompat="@mipmap/ic_launcher"
     app:layout_constraintTop_toTopOf="parent"
     android:layout_marginTop="24dp"
     app:layout_constraintBottom_toBottomOf="parent"
     android:layout_marginBottom="24dp"
     android:layout_marginLeft="24dp"
     app:layout_constraintLeft_toLeftOf="parent"
     android:layout_marginRight="24dp"
     app:layout_constraintRight_toRightOf="parent"/>
   </android.support.constraint.ConstraintLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:padding="@dimen/dp_20"
    android:background="@color/yellow"
    >
        <VideoView
            android:id="@+id/videoview"
            android:layout_width="wrap_content"
            android:layout_centerInParent="true"
            android:layout_height="300dp"
            android:contentDescription="@string/app_name"
             />

        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/camera"
            android:layout_margin="30dp"
            android:layout_alignParentEnd="true"
            android:layout_centerVertical="true"
            android:id="@+id/imageView" />

</RelativeLayout>

在其内部建立相对联系和提出看法,并增加

android:elevation="2dp" 

for

可以通过在XML档案中转交布局之前把背布局放在一边来容易地做到这一点。

例如,如果我希望<代码>卡片1。 页: 1 我写道:

<androidx.cardview.widget.CardView
        android:id="@+id/cardView2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

<androidx.cardview.widget.CardView
        android:id="@+id/cardView1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

以来,第2条 载于cardView1>,cardView1,是另一条。





相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签