当前位置:网站首页>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>
边栏推荐
- Remote office experience sharing | community essay solicitation
- 【AtCoder1983】BBQ Hard (组合数+巧妙模型转化)
- Three expressions of integers and their storage in memory
- [atcoder2306] rearranging (topology)
- 134. 加油站
- 【HDU6357】Hills And Valleys(DP)
- 欧拉定理及扩展(附证明)
- Sort - Swap sort
- Request request object and response response object
- 20200810 T2 dispatch money
猜你喜欢

空间几何

QT picture adaptive display control

After 4 years of naked resignation from the test, the test post of 15K interview was rubbed on the ground, and the result made me collapse and cry

C language - Growth Diary -03- function definition and function prototype declaration

安卓初中级开发基础知识整理(面试自用)

wordcloud的使用

Implementation of stack (C language)

测试4年裸辞失业,面试15k的测试岗被按在地上摩擦,结局让我崩溃大哭...

C- print 99 multiplication table

Using Tkinter to realize guessing numbers game
随机推荐
Second remaining learning notes
Bladed入门教程(视频)
Note: JDBC
Wc2020 course selection
Configuration software -- control import
【CodeForces908H】New Year and Boolean Bridges (FWT)
Simple use of string
Zero foundation self-study SQL course | union joint query
[software testing] 90% of the interviewers have been brushed out of such resumes
String Simulation Implementation
Sort - Swap sort
About static keyword
C. Manipulating History(贪心/哈希/思维/好题)
[atcoder2307] tree game
Nim product
【集群】LVS+keepalived高可用集群
[untitled] Weng_ C lesson 1
.NET C#基础(6):命名空间 - 有名字的作用域
Understanding of Poisson distribution and Poisson process and Erlang distribution and their relations (important theories in queuing theory and operational research)
Djikstra solves the shortest circuit with negative weight