Android 如何在布局中设置ImageView,其中某些部分位于同一布局中,其余部分位于布局之外

Android 如何在布局中设置ImageView,其中某些部分位于同一布局中,其余部分位于布局之外,android,Android,我想把imageview放在一个布局中,这样它的一部分在同一个布局中是可见的,其余部分在它的外部和其他布局上都是可见的 活动主目录 <com.sothree.slidinguppanel.SlidingUpPanelLayout xmlns:sothree="http://schemas.android.com/apk/res-auto" xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/

我想把imageview放在一个布局中,这样它的一部分在同一个布局中是可见的,其余部分在它的外部和其他布局上都是可见的

活动主目录

<com.sothree.slidinguppanel.SlidingUpPanelLayout
xmlns:sothree="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/sliding_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="top"
sothree:umanoFadeColor="@android:color/transparent"
sothree:umanoPanelHeight="0dp"
sothree:umanoShadowHeight="0dp">

<LinearLayout
android:layout_width="match_parent"
android:background="#c4fff8"
android:layout_height="match_parent">

</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="300dp"
android:background="#ffd8b1"
android:orientation="vertical">

<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:background="@drawable/edittext_layout"
android:layout_height="250dp">

</LinearLayout>

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/cat1"
android:layout_marginRight="46dp"
android:layout_marginEnd="46dp"
android:layout_marginBottom="-20dp"
android:id="@+id/imageView6"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
</RelativeLayout>

</LinearLayout>
</com.sothree.slidinguppanel.SlidingUpPanelLayout>
依赖项已从Github获取


我想要这样的布局安排,但有了这种依赖关系,framelayout将无法工作。

您实际上无法在两个布局上放置视图。 如果您只想让imageView看起来像是在两个布局之上,那么可以很好地使用FrameLayout,将imageView放置在这些布局之上


但是,您不可能拥有一个包含两个父布局的视图。

您实际上无法在两个布局上放置视图。 如果您只想让imageView看起来像是在两个布局之上,那么可以很好地使用FrameLayout,将imageView放置在这些布局之上


但是你不可能有一个包含两个父布局的视图。

你能添加屏幕截图吗?你不能有一个包含两个父布局的imageview。我已经上传了屏幕截图。检查它。你能添加屏幕截图吗?你不能有一个包含两个父布局的imageview。我已经上传了屏幕截图。检查它outwe不能将框架布局与此依赖项一起使用,并且它只能有两个子项。尝试一下,如果完成了,那么在这里发布代码。我们不能将框架布局与此依赖项一起使用,它只能有两个子项。尝试一下,如果完成了,那么在这里发布代码。
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:padding="10dp"
android:shape="rectangle"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<stroke android:color="#050505"
android:width="1dp"></stroke>
<solid android:color="#80a7a7a7"/>
</shape>
dependencies {
repositories {
mavenCentral()
}
compile 'com.sothree.slidinguppanel:library:3.3.1'
}