默认(1sp = 1dp) , sp:带缩放的dp(手动改变系统字体大小)

博客指出默认情况下1sp等于1dp,只有在手动改变系统字体大小时这种关系才会改变,涉及移动开发中字体单位相关知识。

默认(1sp = 1dp) , 除非手动改变系统字体大小

接着你刚才优化过的请教你,这次你看看我的布局是不是跟你的设置冲突了:<?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" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity"> <WebView android:id="@+id/mWebView" android:layout_width="match_parent" android:layout_height="match_parent" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toTopOf="@+id/textView" app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent" tools:ignore="NotSibling" /> <com.google.android.material.floatingactionbutton.FloatingActionButton android:id="@+id/floatingButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="1dp" android:importantForAccessibility="no" android:src="@android:drawable/ic_menu_info_details" android:visibility="visible" app:fabSize="mini" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" app:layout_constraintVertical_bias="0.01" /> <ScrollView android:id="@+id/scrollView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:fillViewport="true" android:visibility="visible" tools:ignore="ExtraText,MissingConstraints,SpeakableTextPresentCheck"> <com.google.android.material.textview.MaterialTextView android:id="@+id/textView" android:layout_width="match_parent" android:layout_height="wrap_content" android:justificationMode="inter_word" android:lineSpacingExtra="8dp" android:padding="18dp" android:textSize="20sp" android:visibility="gone" app:autoSizeMinTextSize="18sp" app:autoSizeStepGranularity="1sp" app:autoSizeTextType="uniform" tools:targetApi="26" android:paddingTop="16dp" android:paddingBottom="16dp" /> </ScrollView> <LinearLayout android:id="@+id/buttonGroup" android:layout_width="wrap_content" android:layout_height="wrap_content" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent"> <Button android:id="@+id/speakButton" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="@string/speak" /> <Button android:id="@+id/pauseButton" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="@string/pause" /> <Button android:id="@+id/stopButton" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="@string/stop" /> </LinearLayout> </androidx.constraintlayout.widget.ConstraintLayout>
10-07
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值