位置: 编程技术 - 正文

仿有道词典(有道词典下载安装)

编辑:rootadmin

推荐整理分享仿有道词典(有道词典下载安装),希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:有道词典在线下载,有道词典安卓下载,有道词典hd免费下载,有道词典有道词典下载,有道词典有道词典下载,有道.词典,有道词典有道词典下载,有道词典有道词典下载,内容如对您有帮助,希望把文章链接给更多的朋友!

1、效果图如图所示

2、主要通过webview控件实现仿有道词典的功能

布局文件代码

1、<RelativeLayout xmlns:android=" xmlns:tools=" android:layout_width="match_parent"

android:layout_height="match_parent"

android:background="@drawable/mainbg"

android:paddingBottom="@dimen/activity_vertical_margin"

android:paddingLeft="@dimen/activity_horizontal_margin"

android:paddingRight="@dimen/activity_horizontal_margin"

android:paddingTop="@dimen/activity_vertical_margin"

tools:context=".MainActivity" >

<EditText

android:id="@&#;id/etWord"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_alignParentLeft="true"

android:layout_alignParentTop="true"

android:layout_marginTop="dp"

android:background="@android:drawable/edit_text"

android:ems=""

android:singleLine="true"

android:textColor="#"

android:textColorHint="#f" >

<requestFocus />

</EditText>

<Button

android:id="@&#;id/btnSearch"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_alignRight="@&#;id/tvSearchResult"

android:layout_alignTop="@&#;id/etWord"

android:background="@drawable/ibsearchword"

android:onClick="search" />

<WebView

android:id="@&#;id/wvSearchResult"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:layout_alignLeft="@&#;id/etWord"

android:layout_below="@&#;id/etWord"

android:layout_marginTop="dp"

android:background="@drawable/bg_roundcorner"

android:textAppearance="?android:attr/textAppearanceMedium"

android:textSize="sp" />

</RelativeLayout>

2、mainactivity.xml文件

public class YouDao extends Activity

{

//查询按钮申明

仿有道词典(有道词典下载安装)

private Button myButton;

//清空按钮申明

private Button myButton;

//输入框申明

private EditText mEditText1;

//加载数据的WebView申明

private WebView mWebView1;

public void onCreate(Bundle savedInstanceState)

{

super.onCreate(savedInstanceState);

setContentView(R.layout.main);

//获得布局的几个控件

myButton = (Button)findViewById(R.id.myButton);

myButton = (Button) findViewById(R.id.myButton);

mEditText1 = (EditText) findViewById(R.id.myEditText1);

mWebView1 = (WebView) findViewById(R.id.myWebView1);

//查询按钮添加事件

myButton.setOnClickListener(new Button.OnClickListener()

{

public void onClick(View arg0)

{

String strURI = (mEditText1.getText().toString());

strURI = strURI.trim();

//如果查询内容为空提示

if (strURI.length() == 0)

{

Toast.makeText(YouDao.this, "查询内容不能为空!", Toast.LENGTH_LONG)

.show();

}

//否则则以参数的形式从 else

{

String strURL = " &#; strURI;

mWebView1.loadUrl(strURL);

}

}

});

//清空按钮添加事件,将EditText置空

myButton.setOnClickListener(new Button.OnClickListener()

{

public void onClick(View v)

{

mEditText1.setText("");

}

});

}

private void findByid() { // TODO Auto-generated method stub etWord=(EditText) findViewById(R.id.etWord); btnYes=(Button) findViewById(R.id.btnSelect); btnNo=(Button) findViewById(R.id.btnDelete); wvWord = (WebView) findViewById(R.id.wvShow); } //web视图 class WebViewClient extends WebViewClient { public boolean shouldOverviewUrlLoading(WebView view,String url) { view.loadUrl(url); return true; }}

}

3、必须在AndroidManifest.xml加上联网权限

<uses-permission android:name="android.permission.INTERNET"/>

版权声明:本文为博主原创文章,未经博主允许不得转载。

Android支持百分比布局 Google支持了百分比布局,使用方法很简单1.将你的SDK更新至最新2.在你的build.gradle文件加入dependencies{compile'com.android.support:percent:.2.0'}使用案例:

[置顶] android自定义换行居中CenterTextView 在我们开发app时,TextView一定是使用最多的控件了,android自带的TextView的功能也十分强大,但还是有些小的地方不能满足我们的需求,几天要说的这个功

Android-ContentProvider使用 Android-ContentProvider使用一建立ContentProvider服务器端1建立一个继承自ContentProvider的类并重写接口方法(这里仅打一些log做代表)packagecom.chengzhi.androidcontentprovi

标签: 有道词典下载安装

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

上一篇:Android 常用RGB值以及中英文名称(android颜色值)

下一篇:Android支持百分比布局(安卓百分百)

  • 转让无形资产可以免税吗
  • 房产税如何进行税源采集
  • 税务师事务所是代理记账公司吗
  • 暂估成本跨年后收到票汇算清缴
  • 暂估入账后没有交房产税
  • 个人取得什么收入不交税
  • 作家以及作品
  • 利息股息红利所得
  • 消费税的应纳税额的计算
  • 公关费用明细表
  • 受托加工费直接计入生产成本
  • 营改增租金收入税率
  • 所有的固定资产都需要计提折旧吗
  • 出租的固定资产计提折旧
  • 发票验证系统费用多少钱?
  • 发票没开完可以领取吗?
  • 控股合并吸收合并新设合并图示
  • 工程施工什么时候确认收入
  • 金税三期得死多少企业
  • 收到工程结算单,没有发票,能入成本吗
  • 华为分享的文件在电脑哪个文件夹
  • 临时文件夹移动到c盘根目录下windows7
  • 冲销货款的会计分录
  • 提升一下网速
  • ThinkPHP让../Public在模板不解析(直接输出)的方法 原创
  • php中strcmp函数
  • 托收账款属于什么会计科目
  • linux递归创建目录命令
  • 土地增值税安置房收入的确认原则
  • 公司以知识产权出资纳税筹划
  • 微信小程序webview支付
  • php获取url内容
  • 企业所得税纳税义务发生时间
  • Thinkphp 中 distinct 的用法解析
  • 基于matlab的随机森林回归和交叉验证
  • php ffi
  • Joe是一款优雅功能强大的Typecho主题功能多上手快
  • 企业对外担保能收担保费吗
  • 所得税费用该怎么算
  • 物业公司一般纳税人简易征收
  • 认缴资本怎么填
  • 自用房地产转换为成本模式计量的投资性房地产
  • 让渡资产使用权属于收入吗
  • 建筑企业结转收入方法
  • 应收款项减值讲解视频
  • 建筑施工安全费用提取标准
  • 增值税普票跨月作废怎么操作
  • 原始凭证错误的更正方法
  • 投资收益科目在借方
  • 投资的公司注销了怎么做账
  • 税金及附加科目余额在借方还是贷方
  • 库存退货怎么做账
  • 新公司成立建账流程
  • 怎样计算计时工资
  • mysql优化技巧实战
  • Mysql主从同步Last_IO_Errno:1236错误解决方法
  • Mysql中几种插入效率的实例对比
  • window7 32位系统
  • win8不好吗
  • windows server 2008 r2开启远程访问
  • freebsd ip配置
  • vcpkgsrv.exe是什么进程
  • win8更新8.1
  • onenotewindows10
  • gcasSWUpdater.exe是什么进程 有什么作用 gcasSWUpdater进程查询
  • windows8连wifi
  • Win8系统怎么安装
  • unity4.1
  • nodejss
  • node.js教程详细
  • shell脚本学习指南
  • javascript还有人用吗
  • jquery escape
  • python从入门到精通百度云
  • 发票查询为什么查不出来
  • 工商注册和税务登记费用
  • 学什么专业可以在税务局上班
  • 河北省国家税务局电子税务局官网入口
  • 广州车船税每年交多少
  • 重庆两江新区总工会社会化工作者待遇
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设