位置: 编程技术 - 正文

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

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

  • 实际发生的坏账准备可以税前扣除吗
  • 个人销售商品交什么税
  • 赠品不开票如何做账
  • 水费3个点税
  • 零星采购不要发票可以吗
  • 单位结算卡和公账是一张卡吗
  • 销售返利增值税按哪个税率
  • 坏账冲回要纳税调减吗
  • 营改增一般纳税人标准
  • 固定资产清理如何做账
  • 集团股份怎么分配
  • 企业安全生产费用提取标准 最新
  • 银行利息收入可以开增值税专用发票
  • 以前年度损益调整属于哪类科目
  • 生产企业出口退税流程
  • 经济补偿金如何计税
  • 应征增值税销售额和应税销售额
  • 固定资产简易办法3%减按2%
  • 红字发票勾选平台里有吗
  • 中小企业货币资金内部控制案例
  • 房地产广告公司月费一般多少
  • 建筑企业无票支出如何处理
  • 专用发票右上角的数字表示什么
  • 按揭购入固定资产怎么算
  • 员工劳务报酬分录
  • windows10找不到用户和组
  • 电脑legacy是什么意思
  • 苹果15手机价格和图片颜色
  • php字符串变量
  • win11玩游戏鼠标卡顿
  • 市面最高版本
  • 不能运行windows10的设备有哪些
  • mp3最早什么年代流行
  • vue watch监听vuex数据
  • 内斯塔特点
  • php升级到php7注意的问题
  • 房产税城镇土地使用税税源信息采集
  • 文件上传漏洞原因
  • 设置cmd命令
  • 网络命令netstat
  • 税费的审计
  • 客户不要的专票我们可以不作废吗
  • 出租房屋收取跨年度的预收租金收入
  • 营改增之后还有营业税金及附加吗
  • sqlcoalesce
  • 营改增小规模纳税人认定标准
  • 用sql语句查找年龄大于20
  • mysql group by实现原理
  • 公司注销前欠客户钱
  • 小规模增值税退税流程怎么操作
  • 银行理财产品是单利还是复利
  • 股东权益合计等于净资产吗
  • 发票已经报送怎么处理
  • 去年少交的增值税可以和今年的合并吗
  • 稳岗补贴操作流程
  • 土地前期开发费用属于开发成本吗
  • 应交税费借方如何计算
  • 进项发票已经认证,对方作废了
  • 仓储费用分配率
  • 年底暂估收入,年初怎么做
  • 购置固定资产进项税处理的变迁
  • 五金领用流程
  • 所得税滞纳金怎么算的
  • sql多表关联修改操作
  • mysql绿色版和安装版有什么区别
  • sqlserver用户权限不给增删查改表结构权限
  • ubuntu /opt
  • centos查看inode
  • mac局域网控制windows
  • win7控制面板有哪些功能
  • win7的系统电脑
  • 标记不能
  • win10更新补丁导致打印机
  • perl语句
  • python如何将矩阵转为图像
  • python多线程作用
  • js如何获取cookie的值
  • nodejss
  • 服务端测试是什么意思
  • android root 原理
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设