首页 > 其他分享 >2022-10-07-学习内容

2022-10-07-学习内容

时间:2022-10-07 19:44:42浏览次数:51  
标签:10 07 tv text px TextSizeActivity 2022 import onCreate

1.设置文本字体大小

1.1activity_text_size.xml

<?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">

    <TextView
        android:id="@+id/tv_px"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/hello"
        android:textSize="30px"/>

    <TextView
        android:id="@+id/tv_dp"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/hello"
        android:textSize="30dp"/>

    <TextView
        android:id="@+id/tv_sp"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/hello"
        android:textSize="30sp"/>

</LinearLayout>

1.2TextSizeActivity.java

package com.example.chapter03;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.widget.TextView;

public class TextSizeActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_text_size);
        /*TextView tv_px = findViewById(R.id.tv_px);
        tv_px.setTextSize(30);*/
    }
}

1.3AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.chapter03">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/Theme.MyApplication">
        <activity
            android:name=".TextSizeActivity"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

 

标签:10,07,tv,text,px,TextSizeActivity,2022,import,onCreate
From: https://www.cnblogs.com/pingfanliliang/p/16759533.html

相关文章

  • 「题解」Codeforces GYM 102268 J Jealous Split(300iq Contest 1 J)
    怎么想到的结论?结论是,如果把看成最小化\(\sum{s_i}^2\),那么一定满足条件。证明是考虑如果相邻两段\(s>t\),如果不满足条件即\(s-t>\max\),说明将\(s\)和\(t\)交界处......
  • 解决IntelliJ Idea与Tomcat10关于Servlet5.0不匹配的问题
    在学习Mybatis的时候,创建了一个JavaWeb程序来做试验。出现了以下错误,在网上查了很多,最后在网上发现是Idea里面的Serlvet4.0与Tomcat10不匹配的问题。jakarta.servlet.S......
  • 闲话 22.10.7
    闲话最近洛谷犇犇炸了诶所以没有地方推流了所以开摆了最近想用代数工业优化dp今天社论就是一道但是推广的时候就会遇到很多问题所以有什么偏难怪题让我切吗今天早......
  • 初学C语言笔记221007预处理
    预编译:#include头文件的包含    注释删除    #define汇编代码二进制指令预定义符号__FILE____LINE____DATE____TIME____FUNCTION____STDC__如果严格支持AN......
  • 时光卷轴,IT启示录-2022年-9月刊
    8月份新能源车销售数据出炉前不久,中国汽车工业协会公布了8月份的新能源车销售数据。先来看市场总盘子。8月份,全国新能源车汽车销量创历史新高,为66.6万辆,同比增长了1倍,环......
  • Matlab function 2.22.10.07
    functiony=myfun1(x)z=x+1;y=z*2;functiony=myfun2(x)ifx>10y=99;elseifx>0y=1;elsey=-1;endfunctiony=myfun3(x)switchx......
  • 20220819报错信息
    ​​https://jingyan.baidu.com/article/6079ad0e99bb8228ff86db2b.html​​​​https://www.ilovematlab.cn/thread-559419-1-1.html​​​​https://www.codenong.com/414......
  • 社论 22.10.7
    CF1603F给定三个正整数\(n,k,x\),求满足以下条件的序列\(a_{1...n}\)的个数:对于每一个\(1\leqslanti\leqslantn\),\(0\leqslanta_i<2^k\)。序列\(a\)没......
  • 207. 课程表
    207.课程表你这个学期必须选修numCourses门课程,记为 0 到 numCourses-1。在选修某些课程之前需要一些先修课程。先修课程按数组 prerequisites给出,其中 ......
  • 2022牛客国庆集训派对day6 C 递归构造 归纳构造
    给出一个m你需要构造出来m个m维向量两两向量之间点乘为0向量每一维只能是1或-1保证m一定是2的幂次。直接构造出来那么大的显然不太可能发现不了什么比较好的规律。......