上一页 1 ··· 45 46 47 48 49 50 51 52 53 ··· 186 下一页
摘要: 一,添加字体文件 在res目录下创建font目录,然后把字体文件复制到此目录下,注意:字体文件的文件名请使用英文小写字符 二,代码: xml: <TextView android:id="@+id/textView" android:layout_width="wrap_content" andro 阅读全文
posted @ 2025-05-24 17:55 刘宏缔的架构森林 阅读(76) 评论(0) 推荐(0)
摘要: 一,代码: xml <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/ 阅读全文
posted @ 2025-05-24 17:55 刘宏缔的架构森林 阅读(18) 评论(0) 推荐(0)
摘要: 一,代码: public class AnimActivity extends AppCompatActivity { private Handler handler = new Handler(); private static final long DELAY_TIME = 3000; // 3 阅读全文
posted @ 2025-05-24 17:54 刘宏缔的架构森林 阅读(22) 评论(0) 推荐(0)
摘要: 一,代码: 在oncreate生命周期中添加代码: setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); 如下: protected void onCreate(Bundle savedInstanceState) { 阅读全文
posted @ 2025-05-24 17:54 刘宏缔的架构森林 阅读(33) 评论(0) 推荐(0)
摘要: 一,代码: 原activity //得到launcher ActivityResultLauncher launcher = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), new Act 阅读全文
posted @ 2025-05-24 17:54 刘宏缔的架构森林 阅读(53) 评论(0) 推荐(0)
摘要: 一,代码: //给按钮增加点击事件:旋转 Button rotateButton = findViewById(R.id.rotateButton); rotateButton.setOnClickListener(new View.OnClickListener() { @Override pub 阅读全文
posted @ 2025-05-24 17:54 刘宏缔的架构森林 阅读(22) 评论(0) 推荐(0)
摘要: 一,代码: xml <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/ 阅读全文
posted @ 2025-05-17 08:21 刘宏缔的架构森林 阅读(44) 评论(0) 推荐(0)
摘要: 一,代码 线上的数据: activity package com.example.okdemo1.activity; import android.graphics.Color; import android.os.Build; import android.os.Bundle; import an 阅读全文
posted @ 2025-05-17 08:21 刘宏缔的架构森林 阅读(39) 评论(0) 推荐(0)
摘要: 一,代码: 线上的数据: activity package com.example.okdemo1.activity; import android.graphics.Color; import android.os.Build; import android.os.Bundle; import a 阅读全文
posted @ 2025-05-17 08:21 刘宏缔的架构森林 阅读(32) 评论(0) 推荐(0)
摘要: 一,代码: 线上的数据: activity package com.example.okdemo1.activity; import android.graphics.Color; import android.os.Build; import android.os.Bundle; import a 阅读全文
posted @ 2025-05-17 08:20 刘宏缔的架构森林 阅读(23) 评论(0) 推荐(0)
上一页 1 ··· 45 46 47 48 49 50 51 52 53 ··· 186 下一页