位置: 编程技术 - 正文

Activity添加新View(activity怎么用)

编辑:rootadmin
protected void onCreate(Bundle savedInstanceState) {// TODO Auto-generated method stubsuper.onCreate(savedInstanceState);setContentView(R.layout.write_annot); SPSlate slate = new SPSlate(this); //view slate.setPenSize(2, ); slate.setPenColor(Color.RED); addContentView(slate, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));

推荐整理分享Activity添加新View(activity怎么用),希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:activity view,activity动态添加节点,activity加载流程,android新建activity,activity view,activity view,activity添加fragment,activity添加fragment,内容如对您有帮助,希望把文章链接给更多的朋友!

}

第二种:通过RelativeLayout, 来控制后添加的View的大小:大小填充的是RelativeLayout的大小。

Activity添加新View(activity怎么用)

RelativeLayout mLayout;@Overrideprotected void onCreate(Bundle savedInstanceState) {// TODO Auto-generated method stubsuper.onCreate(savedInstanceState);setContentView(R.layout.write_annot); SPSlate slate = new SPSlate(this); slate.setPenSize(2, ); slate.setPenColor(Color.RED); mLayout = (RelativeLayout)findViewById(R.id.writeAnnotateView); mLayout.addView(slate, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));}

xml: 配置文件

<?xml version="1.0" encoding="utf-8" ?><RelativeLayout xmlns:android=" android:layout_width="match_parent" android:layout_height="match_parent" > <LinearLayout android:layout_width="match_parent" android:layout_height="dp" android:orientation="horizontal"android:background="@android:color/darker_gray"> <ImageButton android:id="@&#;id/confirmBtn" android:layout_width="dp" android:layout_height="dp" android:layout_weight="1" android:background="@drawable/button" android:layout_gravity="center_vertical" android:src="@drawable/c_brushescheckmark_disabled"/> <ImageButton android:id="@&#;id/reDoBtn" android:layout_width="dp" android:layout_height="dp" android:layout_weight="1" android:background="@drawable/button" android:layout_gravity="center_vertical" android:src="@drawable/c_redo_disabled"/> <ImageButton android:id="@&#;id/unDoBtn" android:layout_width="dp" android:layout_height="dp" android:layout_weight="1" android:background="@drawable/button" android:layout_gravity="center_vertical" android:src="@drawable/c_undo_disabled"/> <ImageButton android:id="@&#;id/fontBtn" android:layout_width="dp" android:layout_height="dp" android:layout_weight="1" android:background="@drawable/button" android:layout_gravity="center_vertical" android:src="@drawable/icon_font"/> <ImageButton android:id="@&#;id/colorBtn" android:layout_width="dp" android:layout_height="dp" android:layout_weight="1" android:background="@drawable/button" android:layout_gravity="center_vertical" android:src="@drawable/icon_color"/> </LinearLayout> <RelativeLayout android:id="@&#;id/writeAnnotateView" android:layout_marginTop="dp" android:layout_width="match_parent" android:layout_height="match_parent"> </RelativeLayout> </RelativeLayout>

使用ObjectAnimator或者ValueAnimator来为控件使用动画 如果我要给一个控件做向右移动的动画,可以使用TranstateAnimation来使其向右移动,但是动画执行完成之后控件还是要回到起始位置。如果我需要让一个

BaseAdapter数据刷新,自定义BaseAdapter 在网上的视频看到的一个很好用的自定义BaseAdapter,自己修改了一下后一直在用,分享给大家,这样的话绑定gridView或listView就方便多了,直接在adapter里

IndicatorTabBar——可滑动的带指示条的TabBar 这篇文字给大家分享一个可以滑动的TabBar,这里叫做IndicatorTabBar。先上效果图:诸如网易新闻、腾讯新闻、百度新闻等客户端,都使用了类的TabBar,这

标签: activity怎么用

本文链接地址:https://www.jiuchutong.com/biancheng/379718.html 转载请保留说明!

上一篇:Android学习第10天(android基础入门)

下一篇:使用ObjectAnimator或者ValueAnimator来为控件使用动画(使用权资产)

  • 工业企业取得土地收益
  • 单位出租不动产印花税
  • 支票退票怎么做账务处理
  • 进项税额可以不转出吗
  • 私人口腔诊所会感染艾滋病吗
  • 公务员工资待遇标准表
  • 一般纳税人财务报表月报还是季报
  • 财产租赁个人所得税
  • 金税盘的进项发票怎么导出
  • 工厂员工饭票制度
  • 广告物料制作费公司怎么做账
  • 个人独资企业可以不开公户吗
  • 企业申请增值税专用发票
  • 湿租增值税税率多少
  • 公司以银行存款名义为员工垫付医疗费分录怎么写
  • 资本公积要交印花税账簿税吗
  • 单位不发工资怎么解决要什么证据
  • 来料加工贸易是什么工作
  • 红色手撕发票怎么看金额
  • 鸿蒙大文件夹怎么设置透明度
  • 代扣个税手续费返还增值税税率
  • 王者荣耀英雄印花衣服哪里批发
  • php支付功能
  • 民办学校的财务制度
  • 减值测试步骤
  • 企业税计算方法
  • 建筑工程企业管理费包括哪些内容
  • 网络层IP协议的配套协议有哪些
  • 装修费计入固定资产还是长期待摊
  • labview实例教程
  • 搭建本地http服务器
  • php如何实现重载
  • 待抵扣进项税计入其他应收款
  • 开发票时有哪些规定呢?
  • 幼儿园免征增值税账务处理
  • Pythonround函数作用
  • 三代手续费操作流程
  • 增值税专用发票怎么开
  • mysql怎么修改
  • 删除mysql57服务
  • Windows Server 2003下修改MySQL 5.5数据库data目录
  • 资产减值损失科目
  • 上年折旧没提今年可以补提吗
  • 因管理不善的材料怎么办
  • 股东以私人名义出资
  • 购买库存商品的运输费
  • 分期收款销售的会计与纳税处理
  • 未开票收入如何申报增值税,下个月怎么操作
  • 收到票据又转背书付了账务处理
  • 未开票收入如何申报增值税
  • 固定资产改建支出的扣除规定
  • 框架合同范文
  • 废品相关内容有哪些
  • myeclipse连接mysql失败
  • linux 设置文件系统
  • win7打开文件夹都是独立的窗口
  • 如何将win10系统从c盘迁移到d盘
  • win10组策略编辑器没有
  • windows7hosts文件
  • win10虚拟机不能使用
  • sendmail端口
  • windows8介绍
  • Win10预览版桌面图标和任务栏不翼而飞怎么办?
  • 怎么恢复手机桌面时间和日期
  • cocos2dx3.4 Menu
  • unity拖进模型什么也看不到
  • mac vscode opengl
  • js随机抽取姓名
  • node.js go
  • perl中sub
  • js class属性
  • 使用js如何创建元素
  • 命令行执行bat文件
  • javascript怎么弄
  • Python判断字符串结尾并输出yes或no
  • 深圳前海地铁站几号线
  • 盐城合作医疗在手机上怎么交
  • 租房税多少钱
  • 新车交购置税的流程图
  • 宁波新注册公司什么时候开始报税
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

    网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

    友情链接: 武汉网站建设