位置: 编程技术 - 正文

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

编辑: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支持百分比布局(安卓百分百)

  • 减免的增值税如何计算
  • 装修及室内设计实训报告
  • 一般纳税人金税盘抵税会计分录
  • 实收资本一直挂着其他应收款怎么办
  • 资产处置收益是什么会计科目
  • 报个税的工资表
  • 酒销售账务处理
  • 工会经费的工资薪金总额包括保险吗
  • 营改增对房地产行业的影响
  • 出口货物当期免抵退税不得免征和抵扣税额,应计入
  • 个体工商户能否开13的专票
  • 银行转账结算方式的种类及适用范围
  • 委托加工的账务处理
  • 应收贷方余额怎么处理
  • 其他应付款能转收入么
  • 收到小额贷款怎么做账
  • 企业之间借款该怎么做账
  • 跨年度销售退回所得税
  • 行政单位的会计要素
  • 出口退税和企业所得税
  • 消费税的纳税环节可能有
  • 养牛场增值税的税率是多?
  • 电商一般纳税人如何报税
  • 无产权车位20年到期后还收费吗
  • 公司支付劳务派遣人员工资账务处理
  • 个人所得税怎么交的,怎么算的
  • 公司没有车牌可以买车吗
  • 资产减值损失如何结转本年利润
  • 以前年度少计提收入
  • 累计折旧差错调整减少
  • 增值税小规模纳税人
  • 会计中的贷款核算分录是什么?
  • 车辆的代驾费应该怎么收
  • 购买一台电脑会计分录
  • 如何在excel中计算两列数值的差
  • 编译安装php7
  • 税务局返还的手续费需开发票吗
  • 采购合同付款违约条款怎么签
  • 除了个税还有什么税
  • 存货盘亏能否税前扣除
  • 员工宿舍中介费计入什么科目
  • 库拉索的死
  • 以摊余成本计量的金融负债
  • 进料加工与来料加工均为一进一出的两笔交易
  • php是面向对象语言吗
  • 坏账损失的会计分录
  • php读取json数组中指定内容
  • 补提企业所得税财务报表应该如何调整
  • 一般公司是什么企业类型
  • 母公司收取子公司利润
  • 购销合同印花税税率表
  • 研发费用加计扣除的条件
  • 顶账资产入账依据
  • 购买的电子承兑公司怎么平账做收据
  • 竣工结算的审核要点
  • 印花税的其他凭证指的是什么
  • 厂家给的返利应该怎么做会计分录
  • 发票右上角打印缺数字
  • 收到伙食费的会计处理
  • 固定资产折旧算现金流入吗
  • 最全的免费追漫软件
  • sql高级写法
  • win7小技巧
  • ubuntu 安装zsh
  • grub rescue修复引导找不到grub
  • linux输出结果
  • nvvsvc.exe是什么进程
  • shpc32.exe - shpc32是什么进程 有什么用
  • windows7不显示移动硬盘
  • 怎么在linux中安装软件
  • es6 变量的解构赋值
  • node.js入门
  • shell脚本详解
  • 基于flask的开源项目
  • jquery实现ajax加载超时提示的方法
  • android自学
  • 如何加强部门联动协作
  • 生产变压器有什么危害
  • 房地产增值税怎么算举例说明
  • 什么发票可以抵税
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设