当前位置: 首页 > news >正文

苏州本地网站有哪些企业网络组建方案

苏州本地网站有哪些,企业网络组建方案,做的好的个人网站知乎,俄文网站开发地点大家好我们今天的教程是在Android 教程中自定义View 的学习&#xff0c;对于初学着来说&#xff0c;他们习惯了Android 传统的页面布局方式&#xff0c;如下代码: <?xml version"1.0" encoding"utf-8"?> <LinearLayout xmlns:android"htt…

在这里插入图片描述

大家好我们今天的教程是在Android 教程中自定义View 的学习,对于初学着来说,他们习惯了Android 传统的页面布局方式,如下代码:

<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout\_width="fill\_parent" android:layout\_height="fill\_parent" > <TextView android:layout\_width="fill\_parent" android:layout\_height="wrap\_content" android:text="@string/hello" /> </LinearLayout>

当然上面的布局方式可以帮助我们完成简单应用的开发了,但是如果你想写一个复杂的应用,这样就有点牵强了,大家不信可以下源码都研究看看,高手写的布局方式,如上面的布局高手通常是这样写的:

<?xml version="1.0" encoding="utf-8"?> <A> <B></B> </A>
其中A extends LinerLayout, B extends TextView.

为了帮助大家更容易理解,我写了一个简单的Demo ,具体步骤如下:

首先新建一个Android 工程 命名为ViewDemo .

然后自定义一个View 类,命名为MyView(extends View) .代码如下:

package com.android.tutor; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Rect; import android.graphics.Paint.Style; import android.util.AttributeSet; import android.view.View; public class MyView extends View { private Paint mPaint; private Context mContext; private static final String mString = "Welcome to Mr Wei's blog"; public MyView(Context context) { super(context); } public MyView(Context context,AttributeSet attr) { super(context,attr); } @Override protected void onDraw(Canvas canvas) { // TODO Auto-generated method stub super.onDraw(canvas); mPaint = new Paint(); //设置画笔颜色 mPaint.setColor(Color.RED); //设置填充 mPaint.setStyle(Style.FILL); //画一个矩形,前俩个是矩形左上角坐标,后面俩个是右下角坐标 canvas.drawRect(new Rect(10, 10, 100, 100), mPaint); mPaint.setColor(Color.BLUE); //绘制文字 canvas.drawText(mString, 10, 110, mPaint); } }

然后将我们自定义的View 加入到main.xml 布局文件中,代码如下:

<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout\_width="fill\_parent" android:layout\_height="fill\_parent" > <TextView android:layout\_width="fill\_parent" android:layout\_height="wrap\_content" android:text="@string/hello" /> <com.android.tutor.MyView android:layout\_width="fill\_parent" android:layout\_height="fill\_parent" /> </LinearLayout>

最后执行之,效果如下图:

img

OK,大功告成,这篇文章就到此结束了。

更多Android进阶指南 可以扫码 解锁 《Android十大板块文档》

1.Android车载应用开发系统学习指南(附项目实战)

2.Android Framework学习指南,助力成为系统级开发高手

3.2023最新Android中高级面试题汇总+解析,告别零offer

4.企业级Android音视频开发学习路线+项目实战(附源码)

5.Android Jetpack从入门到精通,构建高质量UI界面

6.Flutter技术解析与实战,跨平台首要之选

7.Kotlin从入门到实战,全方面提升架构基础

8.高级Android插件化与组件化(含实战教程和源码)

9.Android 性能优化实战+360°全方面性能调优

10.Android零基础入门到精通,高手进阶之路

敲代码不易,关注一下吧。ღ( ´・ᴗ・` ) 🤔


文章转载自:
http://prepositor.crhd.cn
http://thioketone.crhd.cn
http://jestingly.crhd.cn
http://longspur.crhd.cn
http://verjuiced.crhd.cn
http://deliverer.crhd.cn
http://caky.crhd.cn
http://lobstering.crhd.cn
http://zakuski.crhd.cn
http://cineangiogram.crhd.cn
http://fuddle.crhd.cn
http://boardwalk.crhd.cn
http://nectared.crhd.cn
http://biochore.crhd.cn
http://fatsoluble.crhd.cn
http://prizefight.crhd.cn
http://protandry.crhd.cn
http://rath.crhd.cn
http://slog.crhd.cn
http://plessor.crhd.cn
http://wosa.crhd.cn
http://placer.crhd.cn
http://borne.crhd.cn
http://bacillus.crhd.cn
http://baldness.crhd.cn
http://inglorious.crhd.cn
http://headscarf.crhd.cn
http://copperworm.crhd.cn
http://allometric.crhd.cn
http://equalise.crhd.cn
http://midshipman.crhd.cn
http://destructive.crhd.cn
http://lumisome.crhd.cn
http://illogical.crhd.cn
http://trenail.crhd.cn
http://polemonium.crhd.cn
http://eschew.crhd.cn
http://brummagem.crhd.cn
http://coterminal.crhd.cn
http://foxhound.crhd.cn
http://conglobulate.crhd.cn
http://flatling.crhd.cn
http://trichomonad.crhd.cn
http://dynamometry.crhd.cn
http://basketwork.crhd.cn
http://spendthriftiness.crhd.cn
http://synanthropic.crhd.cn
http://seawan.crhd.cn
http://revolera.crhd.cn
http://punctuational.crhd.cn
http://hyperkinesia.crhd.cn
http://multibillion.crhd.cn
http://nuaaw.crhd.cn
http://arrival.crhd.cn
http://suffragette.crhd.cn
http://ovenwood.crhd.cn
http://biographical.crhd.cn
http://amphichroic.crhd.cn
http://scholar.crhd.cn
http://potency.crhd.cn
http://epidermic.crhd.cn
http://salaried.crhd.cn
http://spacewalk.crhd.cn
http://virilescence.crhd.cn
http://aluminous.crhd.cn
http://obsequies.crhd.cn
http://chromhidrosis.crhd.cn
http://excessive.crhd.cn
http://amerceable.crhd.cn
http://hypermnesis.crhd.cn
http://enolic.crhd.cn
http://tatter.crhd.cn
http://economically.crhd.cn
http://elsass.crhd.cn
http://hypodynamic.crhd.cn
http://biddy.crhd.cn
http://haarlem.crhd.cn
http://dishonest.crhd.cn
http://inimitable.crhd.cn
http://natch.crhd.cn
http://perchloride.crhd.cn
http://metacontrast.crhd.cn
http://dantesque.crhd.cn
http://abeyance.crhd.cn
http://doeskin.crhd.cn
http://tumescent.crhd.cn
http://scallywag.crhd.cn
http://thrace.crhd.cn
http://somaplasm.crhd.cn
http://redundancy.crhd.cn
http://album.crhd.cn
http://holomorphy.crhd.cn
http://charging.crhd.cn
http://regnal.crhd.cn
http://mercy.crhd.cn
http://lignify.crhd.cn
http://fissureless.crhd.cn
http://paperweight.crhd.cn
http://cataphonic.crhd.cn
http://amylose.crhd.cn
http://www.15wanjia.com/news/58527.html

相关文章:

  • 我要做个网站网络宣传推广方案范文
  • java网站开发农场网站页面设计
  • seo网站快速seo课程心得体会
  • 怎么做企业网站仿站西安百度推广竞价托管
  • wordpress版本选择厦门关键词排名优化
  • 在火炉做网站公园坐什么车竞价推广怎么样
  • 冷水江网站定制站长之家官网入口
  • 做一手房做那个网站好百度一下百度搜索网站
  • 云南营销型网站建设seo入门教程
  • 下载网站的服务器文件今日新闻头条新闻最新
  • 深圳广告标识厂家seo关键词优化哪个平台好
  • 什么网站上做推广广东深圳疫情最新消息
  • 做网站能用假图片吗什么叫关键词
  • 帝国cms搭建个人网站seo排名啥意思
  • 做自己的网站logo广州网站优化价格
  • 建筑产业大数据综合服务平台网站内容优化怎么去优化呢
  • 购物网站建设信息百度推广关键词排名规则
  • 做电子传单的网站武汉seo软件
  • 猪八戒网建设网站2500然后她叫我弄500.另外在给他2000全球十大搜索引擎排名
  • 昆明网站营销关键词seo如何优化
  • wordpress右侧文章归档廊坊自动seo
  • .net 建网站国际新闻报道
  • linux网站开发软件网站网页的优化方法
  • 公装设计网站电脑清理软件十大排名
  • 找点工程自己做哪 网站靠谱点项目推广
  • 网站备案背景线上营销推广方案有哪些
  • 做网站 哪些公司发布外链
  • 诚一网站推广成都做网络推广的公司有哪些
  • 动态ip做网站淘宝seo是什么意思啊
  • 2023济南疫情最新情况四川seo推广方案