http://blog.youkuaiyun.com/salc3k/article/details/6747986

本文汇总了Android开发中关于图片处理和文本混排的关键技巧,包括从SD卡路径读取图片的方法,实现EditText的图文混排,以及在TextView中显示图片的多种方式。通过实例讲解,帮助开发者深入了解并掌握Android开发中常见的图片与文本交互应用。

http://blog.youkuaiyun.com/salc3k/article/details/6747986


根据SD卡路径读取图片 http://www.2cto.com/kf/201307/224447.html      http://www.cnblogs.com/fww330666557/archive/2012/01/13/2321438.html


Android EditText图文混排的总结   

http://blog.youkuaiyun.com/cike110120/article/details/9106027


Android中EditText控件的几种使用方法 http://blog.youkuaiyun.com/ahuier/article/details/8982516


Android开发技巧:像QQ一样输入表情图像  http://www.2cto.com/kf/201109/106425.html


Android学习笔记2 TextView图文混排,显示添加的图片,三种常用方法,亲测

http://blog.youkuaiyun.com/sam_suge/article/details/10727897


Android如何在TextView中显示图片 http://blog.youkuaiyun.com/tangcheng_ok/article/details/7537038







(睿进之眼) root@zzc-IdeaPad-15sALC-2021:~# cd /home/www/wwwroot/DjangoBlog (睿进之眼) root@zzc-IdeaPad-15sALC-2021:/home/www/wwwroot/DjangoBlog# unset _BT_PROJECT_ENV && source /www/server/panel/script/btpyprojectenv.sh DjangoBlog (DjangoBlog) root@zzc-IdeaPad-15sALC-2021:/home/www/wwwroot/DjangoBlog# source /www/server/python_project/vhost/env/DjangoBlog.env (DjangoBlog) root@zzc-IdeaPad-15sALC-2021:/home/www/wwwroot/DjangoBlog# (DjangoBlog) root@zzc-IdeaPad-15sALC-2021:/home/www/wwwroot/DjangoBlog# python manage.py createsuperuser /www/server/pyporject_evn/myblog/lib/python3.10/site-packages/haystack/__init__.py:4: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81. from pkg_resources import DistributionNotFound, get_distribution, parse_version Traceback (most recent call last): File "/www/server/pyporject_evn/myblog/lib/python3.10/site-packages/django/db/backends/mysql/base.py", line 15, in <module> import MySQLdb as Database ModuleNotFoundError: No module named &#39;MySQLdb&#39; The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/home/www/wwwroot/DjangoBlog/manage.py", line 22, in <module> execute_from_command_line(sys.argv) File "/www/server/pyporject_evn/myblog/lib/python3.10/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line utility.execute() File "/www/server/pyporject_evn/myblog/lib/python3.10/site-packages/django/core/management/__init__.py", line 416, in execute django.setup() File "/www/server/pyporject_evn/myblog/lib/python3.10/site-packages/django/__init__.py", line 24, in setup apps.populate(settings.INSTALLED_APPS) File "/www/server/pyporject_evn/myblog/lib/python3.10/site-packages/django/apps/registry.py", line 116, in populate app_config.import_models() File "/www/server/pyporject_evn/myblog/lib/python3.10/site-packages/django/apps/config.py", line 269, in import_models self.models_module = import_module(models_module_name) File "/www/server/pyporject_evn/versions/3.10.16/lib/python3.10/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1050, in _gcd_import File "<frozen importlib._bootstrap>", line 1027, in _find_and_load File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 688, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 883, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "/www/server/pyporject_evn/myblog/lib/python3.10/site-packages/django/contrib/auth/models.py", line 3, in <module> from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager File "/www/server/pyporject_evn/myblog/lib/python3.10/site-packages/django/contrib/auth/base_user.py", line 57, in <module> class AbstractBaseUser(models.Model): File "/www/server/pyporject_evn/myblog/lib/python3.10/site-packages/django/db/models/base.py", line 143, in __new__ new_class.add_to_class("_meta", Options(meta, app_label)) File "/www/server/pyporject_evn/myblog/lib/python3.10/site-packages/django/db/models/base.py", line 371, in add_to_class value.contribute_to_class(cls, name) File "/www/server/pyporject_evn/myblog/lib/python3.10/site-packages/django/db/models/options.py", line 243, in contribute_to_class self.db_table, connection.ops.max_name_length() File "/www/server/pyporject_evn/myblog/lib/python3.10/site-packages/django/utils/connection.py", line 15, in __getattr__ return getattr(self._connections[self._alias], item) File "/www/server/pyporject_evn/myblog/lib/python3.10/site-packages/django/utils/connection.py", line 62, in __getitem__ conn = self.create_connection(alias) File "/www/server/pyporject_evn/myblog/lib/python3.10/site-packages/django/db/utils.py", line 193, in create_connection backend = load_backend(db["ENGINE"]) File "/www/server/pyporject_evn/myblog/lib/python3.10/site-packages/django/db/utils.py", line 113, in load_backend return import_module("%s.base" % backend_name) File "/www/server/pyporject_evn/versions/3.10.16/lib/python3.10/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "/www/server/pyporject_evn/myblog/lib/python3.10/site-packages/django/db/backends/mysql/base.py", line 17, in <module> raise ImproperlyConfigured( django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module. Did you install mysqlclient?
08-15
[uWSGI] getting INI configuration from /home/zzc/web_Django/myproject/uwsgi.ini *** Starting uWSGI 2.0.30 (64bit) on [Wed Aug 13 14:19:41 2025] *** compiled with version: 11.4.0 on 12 August 2025 11:59:17 os: Linux-6.8.0-40-generic #40~22.04.3-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 30 17:30:19 UTC 2 nodename: zzc-IdeaPad-15sALC-2021 machine: x86_64 clock source: unix pcre jit disabled detected number of CPU cores: 12 current working directory: /home/zzc/web_Django/myproject writing pidfile to /home/zzc/web_Django/myproject/uwsgi.pid detected binary path: /www/server/pyporject_evn/睿进之眼/bin/uwsgi setgid() to 1000 set additional group 4 (adm) set additional group 24 (cdrom) set additional group 27 (sudo) set additional group 30 (dip) set additional group 46 (plugdev) set additional group 122 (lpadmin) set additional group 135 (lxd) set additional group 136 (sambashare) setuid() to 1000 chdir() to /home/zzc/web_Django/myproject your processes number limit is 71072 your memory page size is 4096 bytes detected max file descriptor number: 1024 lock engine: pthread robust mutexes thunder lock: disabled (you can enable it with --thunder-lock) uWSGI http bound on 0.0.0.0:18999 fd 4 uwsgi socket 0 bound to TCP address 127.0.0.1:34993 (port auto-assigned) fd 3 Python version: 3.13.2 (main, Aug 12 2025, 19:45:25) [GCC 11.4.0] Python main interpreter initialized at 0x580c36707f70 python threads support enabled your server socket listen backlog is limited to 100 connections your mercy for graceful operations on workers is 60 seconds mapped 703600 bytes (687 KB) for 8 cores *** Operational MODE: preforking+threaded *** Traceback (most recent call last): File "/home/zzc/web_Django/myproject/myproject/wsgi.py", line 12, in <module> from django.core.wsgi import get_wsgi_application ModuleNotFoundError: No module named &#39;django&#39; unable to load app 0 (mountpoint=&#39;&#39;) (callable not found or import error) *** no app loaded. going in full dynamic mode *** *** uWSGI is running in multiple interpreter mode *** spawned uWSGI master process (pid: 119989) spawned uWSGI worker 1 (pid: 119990, cores: 2) spawned uWSGI worker 2 (pid: 119991, cores: 2) spawned uWSGI worker 3 (pid: 119992, cores: 2) spawned uWSGI worker 4 (pid: 119993, cores: 2) spawned uWSGI http 1 (pid: 119994) [uWSGI] getting INI configuration from /home/zzc/web_Django/myproject/uwsgi.ini *** Starting uWSGI 2.0.30 (64bit) on [Wed Aug 13 15:02:56 2025] *** compiled with version: 11.4.0 on 12 August 2025 11:59:17 os: Linux-6.8.0-40-generic #40~22.04.3-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 30 17:30:19 UTC 2 nodename: zzc-IdeaPad-15sALC-2021 machine: x86_64 clock source: unix pcre jit disabled detected number of CPU cores: 12 current working directory: /home/zzc/web_Django/myproject writing pidfile to /home/zzc/web_Django/myproject/uwsgi.pid detected binary path: /www/server/pyporject_evn/睿进之眼/bin/uwsgi setgid() to 1000 set additional group 4 (adm) set additional group 24 (cdrom) set additional group 27 (sudo) set additional group 30 (dip) set additional group 46 (plugdev) set additional group 122 (lpadmin) set additional group 135 (lxd) set additional group 136 (sambashare) setuid() to 1000 chdir() to /home/zzc/web_Django/myproject your processes number limit is 71072 your memory page size is 4096 bytes detected max file descriptor number: 1024 lock engine: pthread robust mutexes thunder lock: disabled (you can enable it with --thunder-lock) uWSGI http bound on 0.0.0.0:18999 fd 4 uwsgi socket 0 bound to TCP address 127.0.0.1:33967 (port auto-assigned) fd 3 Python version: 3.13.2 (main, Aug 12 2025, 19:45:25) [GCC 11.4.0] Python main interpreter initialized at 0x6408652e2f70 python threads support enabled your server socket listen backlog is limited to 100 connections your mercy for graceful operations on workers is 60 seconds mapped 703600 bytes (687 KB) for 8 cores *** Operational MODE: preforking+threaded *** Traceback (most recent call last): File "/home/zzc/web_Django/myproject/myproject/wsgi.py", line 12, in <module> from django.core.wsgi import get_wsgi_application ModuleNotFoundError: No module named &#39;django&#39; unable to load app 0 (mountpoint=&#39;&#39;) (callable not found or import error) *** no app loaded. going in full dynamic mode *** *** uWSGI is running in multiple interpreter mode *** spawned uWSGI master process (pid: 169369) spawned uWSGI worker 1 (pid: 169370, cores: 2) spawned uWSGI worker 2 (pid: 169371, cores: 2) spawned uWSGI worker 3 (pid: 169372, cores: 2) spawned uWSGI worker 4 (pid: 169373, cores: 2) spawned uWSGI http 1 (pid: 169374) --- no python application found, check your startup logs for errors --- [pid: 169372|app: -1|req: -1/1] 192.168.31.19 () {38 vars in 847 bytes} [Wed Aug 13 15:03:42 2025] GET / => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 0) --- no python application found, check your startup logs for errors --- [pid: 169372|app: -1|req: -1/2] 192.168.31.19 () {38 vars in 807 bytes} [Wed Aug 13 15:03:43 2025] GET /favicon.ico => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 1) --- no python application found, check your startup logs for errors --- [pid: 169372|app: -1|req: -1/3] 192.168.31.19 () {38 vars in 847 bytes} [Wed Aug 13 15:24:03 2025] GET / => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 0) --- no python application found, check your startup logs for errors --- [pid: 169373|app: -1|req: -1/4] 192.168.31.19 () {38 vars in 807 bytes} [Wed Aug 13 15:24:05 2025] GET /favicon.ico => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 0) [uWSGI] getting INI configuration from /home/zzc/webbi/myproject/uwsgi.ini *** Starting uWSGI 2.0.30 (64bit) on [Wed Aug 13 16:59:15 2025] *** compiled with version: 11.4.0 on 12 August 2025 11:59:17 os: Linux-6.8.0-40-generic #40~22.04.3-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 30 17:30:19 UTC 2 nodename: zzc-IdeaPad-15sALC-2021 machine: x86_64 clock source: unix pcre jit disabled detected number of CPU cores: 12 current working directory: /home/zzc/webbi/myproject writing pidfile to /home/zzc/webbi/myproject/uwsgi.pid detected binary path: /www/server/pyporject_evn/睿进之眼/bin/uwsgi setgid() to 1001 setuid() to 1001 chdir() to /home/zzc/webbi/myproject your processes number limit is 71072 your memory page size is 4096 bytes detected max file descriptor number: 1024 lock engine: pthread robust mutexes thunder lock: disabled (you can enable it with --thunder-lock) uWSGI http bound on 0.0.0.0:8000 fd 4 uwsgi socket 0 bound to TCP address 127.0.0.1:40783 (port auto-assigned) fd 3 Python version: 3.13.2 (main, Aug 12 2025, 19:45:25) [GCC 11.4.0] Python main interpreter initialized at 0x626f41fdaf70 python threads support enabled your server socket listen backlog is limited to 100 connections your mercy for graceful operations on workers is 60 seconds mapped 703600 bytes (687 KB) for 8 cores *** Operational MODE: preforking+threaded *** Traceback (most recent call last): File "/home/zzc/webbi/myproject/myproject/wsgi.py", line 12, in <module> from django.core.wsgi import get_wsgi_application ModuleNotFoundError: No module named &#39;django&#39; unable to load app 0 (mountpoint=&#39;&#39;) (callable not found or import error) *** no app loaded. going in full dynamic mode *** *** uWSGI is running in multiple interpreter mode *** spawned uWSGI master process (pid: 177885) spawned uWSGI worker 1 (pid: 177886, cores: 2) spawned uWSGI worker 2 (pid: 177887, cores: 2) spawned uWSGI worker 3 (pid: 177888, cores: 2) spawned uWSGI worker 4 (pid: 177889, cores: 2) spawned uWSGI http 1 (pid: 177890) --- no python application found, check your startup logs for errors --- [pid: 177888|app: -1|req: -1/1] 192.168.31.19 () {42 vars in 906 bytes} [Wed Aug 13 17:06:12 2025] GET / => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 0) --- no python application found, check your startup logs for errors --- [pid: 177886|app: -1|req: -1/2] 192.168.31.19 () {38 vars in 845 bytes} [Wed Aug 13 17:06:13 2025] GET / => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 0) --- no python application found, check your startup logs for errors --- [pid: 177886|app: -1|req: -1/3] 192.168.31.19 () {40 vars in 876 bytes} [Wed Aug 13 17:06:36 2025] GET / => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 1) [uWSGI] getting INI configuration from /home/zzc/webbi/myproject/uwsgi.ini *** Starting uWSGI 2.0.30 (64bit) on [Thu Aug 14 11:32:57 2025] *** compiled with version: 11.4.0 on 12 August 2025 11:59:17 os: Linux-6.8.0-40-generic #40~22.04.3-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 30 17:30:19 UTC 2 nodename: zzc-IdeaPad-15sALC-2021 machine: x86_64 clock source: unix pcre jit disabled detected number of CPU cores: 12 current working directory: /home/zzc/webbi/myproject writing pidfile to /home/zzc/webbi/myproject/uwsgi.pid detected binary path: /www/server/pyporject_evn/睿进之眼/bin/uwsgi setgid() to 1001 setuid() to 1001 chdir() to /home/zzc/webbi/myproject your processes number limit is 71072 your memory page size is 4096 bytes detected max file descriptor number: 1024 lock engine: pthread robust mutexes thunder lock: disabled (you can enable it with --thunder-lock) uWSGI http bound on 0.0.0.0:8000 fd 4 uwsgi socket 0 bound to TCP address 127.0.0.1:42601 (port auto-assigned) fd 3 Python version: 3.13.2 (main, Aug 12 2025, 19:45:25) [GCC 11.4.0] Python main interpreter initialized at 0x5e3342bfaf70 python threads support enabled your server socket listen backlog is limited to 100 connections your mercy for graceful operations on workers is 60 seconds mapped 703600 bytes (687 KB) for 8 cores *** Operational MODE: preforking+threaded *** Traceback (most recent call last): File "/home/zzc/webbi/myproject/myproject/wsgi.py", line 12, in <module> from django.core.wsgi import get_wsgi_application ModuleNotFoundError: No module named &#39;django&#39; unable to load app 0 (mountpoint=&#39;&#39;) (callable not found or import error) *** no app loaded. going in full dynamic mode *** *** uWSGI is running in multiple interpreter mode *** spawned uWSGI master process (pid: 217377) spawned uWSGI worker 1 (pid: 217378, cores: 2) spawned uWSGI worker 2 (pid: 217379, cores: 2) spawned uWSGI worker 3 (pid: 217380, cores: 2) spawned uWSGI worker 4 (pid: 217381, cores: 2) spawned uWSGI http 1 (pid: 217382) --- no python application found, check your startup logs for errors --- [pid: 217378|app: -1|req: -1/1] 192.168.31.19 () {42 vars in 907 bytes} [Thu Aug 14 11:33:49 2025] GET / => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 0) --- no python application found, check your startup logs for errors --- [pid: 217378|app: -1|req: -1/2] 192.168.31.19 () {38 vars in 845 bytes} [Thu Aug 14 11:33:49 2025] GET / => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 1) --- no python application found, check your startup logs for errors --- [pid: 217379|app: -1|req: -1/3] 192.168.31.19 () {38 vars in 804 bytes} [Thu Aug 14 11:33:50 2025] GET /favicon.ico => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 0) [uWSGI] getting INI configuration from /home/zzc/webbi/myproject/uwsgi.ini *** Starting uWSGI 2.0.30 (64bit) on [Thu Aug 14 11:46:03 2025] *** compiled with version: 11.4.0 on 12 August 2025 11:59:17 os: Linux-6.8.0-40-generic #40~22.04.3-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 30 17:30:19 UTC 2 nodename: zzc-IdeaPad-15sALC-2021 machine: x86_64 clock source: unix pcre jit disabled detected number of CPU cores: 12 current working directory: /home/zzc/webbi/myproject writing pidfile to /home/zzc/webbi/myproject/uwsgi.pid detected binary path: /www/server/pyporject_evn/睿进之眼/bin/uwsgi setgid() to 1001 setuid() to 1001 chdir() to /home/zzc/webbi/myproject your processes number limit is 71072 your memory page size is 4096 bytes detected max file descriptor number: 1024 lock engine: pthread robust mutexes thunder lock: disabled (you can enable it with --thunder-lock) uWSGI http bound on 0.0.0.0:8000 fd 4 uwsgi socket 0 bound to TCP address 127.0.0.1:36627 (port auto-assigned) fd 3 Python version: 3.13.2 (main, Aug 12 2025, 19:45:25) [GCC 11.4.0] Python main interpreter initialized at 0x5dd863e03f70 python threads support enabled your server socket listen backlog is limited to 100 connections your mercy for graceful operations on workers is 60 seconds mapped 703600 bytes (687 KB) for 8 cores *** Operational MODE: preforking+threaded *** Traceback (most recent call last): File "/home/zzc/webbi/myproject/myproject/wsgi.py", line 12, in <module> from django.core.wsgi import get_wsgi_application ModuleNotFoundError: No module named &#39;django&#39; unable to load app 0 (mountpoint=&#39;&#39;) (callable not found or import error) *** no app loaded. going in full dynamic mode *** *** uWSGI is running in multiple interpreter mode *** spawned uWSGI master process (pid: 218691) spawned uWSGI worker 1 (pid: 218692, cores: 2) spawned uWSGI worker 2 (pid: 218693, cores: 2) spawned uWSGI worker 3 (pid: 218694, cores: 2) spawned uWSGI worker 4 (pid: 218695, cores: 2) spawned uWSGI http 1 (pid: 218696) --- no python application found, check your startup logs for errors --- [pid: 218695|app: -1|req: -1/1] 127.0.0.1 () {52 vars in 1167 bytes} [Thu Aug 14 11:49:02 2025] GET / => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 0) --- no python application found, check your startup logs for errors --- [pid: 218693|app: -1|req: -1/2] 127.0.0.1 () {50 vars in 1098 bytes} [Thu Aug 14 11:49:02 2025] GET /favicon.ico => generated 21 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 0)怎么解决
08-15
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值