腾讯云
开发者社区
文档
建议反馈
控制台
首页
学习
活动
专区
工具
TVP
最新优惠活动
文章/答案/技术大牛
搜索
搜索
关闭
发布
登录/注册
精选内容/技术社群/优惠产品,
尽在小程序
立即前往
文章
问答
视频
沙龙
2
回答
Android,ConstraintLayout:在保持约束的同时,位置一个接一个地查看
android
、
listview
、
android-constraintlayout
我在努力想办法解决这个问题。 基本上,我已经有了一个页眉和一个页脚的布局。我需要在剩余的空间中放置一个ListView和两个视图,以便: ListView从顶部开始,并填充所有可用空间。 View1就在ListView后面 View2就在View1后面 如果ListView不可见(或非常短),则视图应显示在屏幕顶部。 ListView应该扩展到screen_heigth -header -footer -view1 -view2 我尝试了每一种可能的链式组合,将视图放入linearLayouts中,只使用约束和偏倚,但我得到的最接近的东西是将视图按正确的顺序打包,而
浏览 1
提问于2018-10-24
得票数 0
回答已采纳
2
回答
用ConstraintLayout在两个尺寸上的比率显示3个相同尺寸的方格
android
、
android-layout
、
android-constraintlayout
我想用ConstraintLayout显示3个相同尺寸的方格。方格的大小必须是屏幕高度的1/3。我想知道如何使用ConstraintLayout来实现它。 我从下面的代码开始: <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width=
浏览 5
提问于2017-04-01
得票数 1
回答已采纳
1
回答
ConstraintLayout安卓系统中的链接链
android
、
android-constraintlayout
如何链接多个不同风格的链(散布,打包..)在约束布局中? 换句话说,如何在同一轴(水平/垂直)上创建一组已经处于不同样式链中的一组视图? 如图所示: <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" an
浏览 0
提问于2019-03-18
得票数 3
1
回答
如何在ConstraintLayout android中使水平等分视图的内容中心
android
、
android-constraintlayout
、
chain
、
android-layout-weight
我需要平分三个视图,视图的内容要居中。我尝试使用链接: 但我无法使风景中心和平分。我也尝试过使用app:layout_constraintHorizontal_weight,但这不起作用。然后,我尝试使用链子,如下所示: <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
浏览 5
提问于2022-05-14
得票数 0
1
回答
如何在ConstraintLayout内制作最小高度的可伸缩视图?
android
、
android-constraintlayout
我想要实现的是组成两个视图,其中一个有固定的高宽比,另一个保持在第一个(除非第一个给予足够的空间为第二个)。 以下是一个案例: 以下是第二个案例: 这两个视图放置在ConstraintLayout中。我试着使用这部分代码: <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/andr
浏览 0
提问于2019-01-23
得票数 1
2
回答
这2 ConstraintLayouts等效吗?
android
、
xml
、
android-layout
、
layout
这两种情况在约束布局中是否等效? 第一种情况: 要素1的属性: android:id="@+id/view1" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" 要素2的属性: android:id="@+id/view2" app:layout_constraintEnd_toEndOf="parent" app:layout_cons
浏览 11
提问于2022-11-09
得票数 0
回答已采纳
3
回答
约束视图在setX之后不更新位置
android
、
android-constraintlayout
我有两个视图,其中一个视图位于另一个视图的下方,如下所示(这两个视图都是同一个父对象的子视图: <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height
浏览 2
提问于2018-03-12
得票数 0
4
回答
如何在Android约束布局中支持水平位置3个视图的wrap_content和match_parent条件
android
、
android-layout
、
android-constraintlayout
我想创建一个在水平位置包含3个视图的复合视图。当我将这个复合视图的宽度设置为WRAP_CONTENT时,我希望这三个视图并排放置,因为它是WRAP_CONTENT。但是当我将宽度设置为MATCH_PARENT时,我希望第二个视图占据整个屏幕空间(但仍然是第二个视图位于第一个视图旁边)。 示例: WRAP_CONTENT: View1空空间-- view2 - view3 -- MATCH_PARENT: 视图1 view2 --空空间--视图3 由于某些原因,我不得不在这里使用约束布局。 我已经尝试了下面的代码。当我尝试将第二个视图的宽度更改为WRAP_CONTENT,并将整个约束布局设置为M
浏览 0
提问于2019-06-15
得票数 2
3
回答
(安卓)在视图上放置ProgressBar
android
、
android-studio
、
android-layout
我想把ProgressBar放在视图的最前面。这是我的xml文件,ProgressBar目前正在后面,由视图覆盖。 <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto
浏览 2
提问于2020-09-09
得票数 2
回答已采纳
2
回答
如何在约束布局中将两个视图的中心对齐的情况下将一个视图放在另一个视图的顶部?
android
、
android-constraintlayout
布局: <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent"
浏览 121
提问于2019-05-21
得票数 0
回答已采纳
2
回答
嵌套ConstraintLayouts未显示
android
、
android-layout
、
android-constraintlayout
我有两个ConstraintLayout的分割成两半,这样: <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_widt
浏览 14
提问于2022-11-13
得票数 0
2
回答
无法在文本更改时调整项目组并尊重页边距
android
、
android-layout
、
android-view
、
android-constraintlayout
我使用以下布局: <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_paren
浏览 2
提问于2019-10-26
得票数 1
回答已采纳
2
回答
在ConstraintLayout中为指导对象添加页边距
android
、
android-constraintlayout
、
constraintlayout-guideline
这个是可能的吗? 我要以下几点: 定义高度(如64 25)的头,4行均匀分布的高度(视图高度的25%减去标题高度<= )) 我能用ConstraintLayout来达到这个目的吗? 问题 我想要添加一个固定高度的标头,并且我希望百分比约束不根据ConstraintLayout的高度计算它们的百分比,而是根据ConstraintLayout中减去标头后的剩余空间来计算它们的百分比。 重要注 是的,我可以将整个ConstraintLayout封装在一个LinearLayout中,但我对一个仅基于ConstraintLayout的解决方案感兴趣。 编辑1 为了更清楚地说明这一点,我想: h_f
浏览 7
提问于2021-08-29
得票数 0
回答已采纳
1
回答
在约束布局上设置最大高度
java
、
android
、
android-layout
、
constraints
、
android-constraintlayout
我在约束布局中有一个列表视图。当它有更多的列表时,希望限制父布局高度。如何以编程方式设置bottom_layout的最大布局高度?最大显示设备高度的80%。 布局是这样的: <androidx.constraintlayout.widget.ConstraintLayout android:id="@+id/bottom_layout" android:layout_width="match_parent" android:layout_height="wrap_content"
浏览 46
提问于2021-05-23
得票数 2
回答已采纳
4
回答
ConstraintLayout防止顶部和底部小部件的重叠
android
、
android-layout
、
android-constraintlayout
、
android-layout-weight
我试图创建一个包含三组小部件的布局。我想要一组被限制在顶部,一组被限制在底部,另一组在两组之间的空间中间浮动。布局将在一个片段中使用,因此它可能会被压缩,特别是当显示键盘时。我很难弄清楚如何防止两组的重叠,同时保持顶部和底部被限制在布局的顶部和底部。 我想出了几种方法来做这件事,但我想不出如何正确地实现任何一种方法。 使用app:layout_constraintVertical_bias或app:layout_constraintVertical_weight将小部件拉在一起或将它们分散开来。 使用一条链,但在两组之间有中断。我想不出如何把链条分成几个部分,以便让不同的群体分散开来。
浏览 2
提问于2019-10-04
得票数 1
1
回答
如何定义垂直堆叠和水平对齐其引用视图的流虚拟布局?
android-constraintlayout
我定义了一个包含Flow虚拟布局的ConstraintLayout,它紧密包装并垂直堆叠了三个视图,如下所示: <androidx.constraintlayout.widget.ConstraintLayout android:layout_width="match_parent" android:layout_height="match_parent"> <View android:id="@+id/view1" android:layout_width="
浏览 32
提问于2021-01-09
得票数 0
回答已采纳
4
回答
底部导航视图与RecyclerView的最后一项重叠
android
、
android-recyclerview
、
overlap
、
bottomnavigationview
RecyclerView的最后一项正在被BottomNavigationView重叠。描述和时间正在被BottomNavigationView重叠。 framgment_news.xml:这是我的RecyclerView <android.support.constraint.ConstraintLayout ... android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".Fragments.NewsFragment"
浏览 0
提问于2019-03-15
得票数 5
回答已采纳
1
回答
如何在ConstraintLayout中将一个视图的边缘设置为另一个视图的中心?
android
、
alignment
我知道以前有人问过这个问题,但我不明白为什么这段代码不能工作。我试图将view1的底部边缘与view2的中心对齐: <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" xmlns:app="http://
浏览 0
提问于2018-07-17
得票数 0
3
回答
Android约束布局不按预期工作
android
、
xml
、
android-layout
、
android-constraintlayout
我有一个活动的根标记为 androidx.constraintlayout.widget.ConstraintLayout 我在这个活动中包括3个布局文件,并垂直列出它们。中间的下列约束不起作用 app:layout_constraintTop_toBottomOf="@+id/lay1" app:layout_constraintBottom_toTopOf="@+id/lay3" 我不明白为什么中间的是整个屏幕,而不是从顶部的底部开始,在底部的顶部结束。你能帮帮我吗? 活动: <androidx.constraintlayout.wid
浏览 0
提问于2019-08-03
得票数 10
回答已采纳
3
回答
华为广告实现中的本地广告MediaView与约束不匹配
android
、
ads
、
huawei-mobile-services
、
huawei-developers
、
huawei-ads
我正在使用在安卓系统中实现本地广告。当我根据屏幕大小(0 Dp)更改MediaView的高度时,我发现它无法更改。 尽管我已经实现了setOnHierarchyChangeListener,但它也不起作用。以下是我目前所取得的成就。 文件native_ad.xml <com.huawei.hms.ads.nativead.NativeView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-aut
浏览 3
提问于2021-10-20
得票数 3
扫码
添加站长 进交流群
领取专属
10元无门槛券
手把手带您无忧上云
相关
资讯
为什么ConstraintLayout代替其他布局?
用Marvelous Designer是如何构建人物角色3d服装的
UG使用技巧总结
UG使用小技巧总结,收藏备用
UG使用技巧总结,熟练掌握事半功倍!
热门
标签
更多标签
云服务器
即时通信 IM
ICP备案
对象存储
实时音视频
活动推荐
运营活动
广告
关闭
领券