gpt4 book ai didi

Android 在两个 View 之间放置一个 ImageView

转载 作者:行者123 更新时间:2023-11-29 00:16:27 25 4
gpt4 key购买 nike

我需要创建如图所示的布局。带有箭头的圆形按钮需要恰好位于蓝色和灰色背景之间。如果不精确指定边距,我很难放置它,这是我不想做的事情,因为不能保证它在所有分辨率和设备上看起来都很好。我将不胜感激 xml 示例

谢谢! enter image description here

最佳答案

Screenshot

使用所需的 drawable.. 希望它能正常工作.. 您可以根据需要设置宽度和高度。

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

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

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:background="#1b96d9"
android:orientation="vertical" >
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="#e6e6e6"
android:orientation="vertical" >
</LinearLayout>
</LinearLayout>

<ImageView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/arrow" />
</FrameLayout>

</LinearLayout>

关于Android 在两个 View 之间放置一个 ImageView ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26578418/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com