当前位置:网站首页>ConstraintLayout中使用Guideline限制控件最大宽度
ConstraintLayout中使用Guideline限制控件最大宽度
2022-06-11 07:47:00 【tinyvampirepudge】
ConstraintLayout中使用Guideline限制控件最大宽度
下面的 ll_container 最大宽度被限制了:最大宽度是屏幕宽度 - 88dp。
ll_container本身宽度可变,有最大宽度限制。
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_begin="44dp" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_end="44dp" />
<LinearLayout
android:id="@+id/ll_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:gravity="center_vertical"
android:orientation="vertical"
app:layout_constrainedWidth="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="@id/guideline1"
app:layout_constraintRight_toRightOf="@id/guideline2"
app:layout_constraintTop_toTopOf="parent">
...
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
边栏推荐
- Three expressions of integers and their storage in memory
- Classes and objects (Part 2)
- [atcoder2306] rearranging (topology)
- TiDB Cloud 上线 Google Cloud Marketplace,以全新一栈式实时 HTAP 数据库赋能全球开发者
- Xshell7 和 Xftp7要继续使用此程序,您必须应用最新的更新或者使用新版本
- [poj3691] DNA repair (AC automata +dp)
- JSP development model
- About static keyword
- Detailed explanation of shift operator and bit operator in C language
- 【集群】LVS+keepalived高可用集群
猜你喜欢

零基础自学SQL课程 | UNION 联合查询

The solution of "no startup device" after running Bochs

Data visualization and Matplotlib

Tidb cloud launched Google cloud marketplace, empowering global developers with a new stack of real-time HTAP databases

Use of wordcloud

Black Qunhui dsm7.0.1 physical machine installation tutorial
![[IOT] intelligent hardware: how to obtain the WiFi signal strength of hardware products](/img/85/5766d8269391820b5e142178530657.png)
[IOT] intelligent hardware: how to obtain the WiFi signal strength of hardware products

How to output the percent sign "%" in printf function in C language

QT picture adaptive display control

Deux diplômés, la Banque a externalisé le travail d'essai pendant plus de quatre mois. Parler de vrais sentiments...
随机推荐
20200730 T3 small B farm [maximum perimeter empty rectangle (monotone stack + line segment tree)] & "ROI 2017 day 2" learning track
Xshell7 和 Xftp7要继续使用此程序,您必须应用最新的更新或者使用新版本
【AtCoder2000】Leftmost Ball (DP+组合数)
wordcloud的使用
排序——归并排序
Bidirectional linked list simple template (pointer version)
[untitled] Weng_ C lesson 1
C language - Growth Diary -01- count primes and sum
[atcoder1984] wide swap
Understanding of Poisson distribution and Poisson process and Erlang distribution and their relations (important theories in queuing theory and operational research)
[poj3691] DNA repair (AC automata +dp)
【AtCoder2376】Black and White Tree(博弈)
Sort - Swap sort
Using Tkinter to realize guessing numbers game
You got 8K in the 3-year function test, but you were actually pretending to work hard
Request request object and response response object
Summary of evaluation index knowledge points in target detection: summary of IOU cross overlap unit and map/ap/tp/fp/np
Import on CSDN MD file
排序——交换排序
远程办公经验 | 社区征文