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

制作网站怎么做滚动条百度竞价推广价格

制作网站怎么做滚动条,百度竞价推广价格,个体户做网站去哪里做,怎么自己给自己的网站做推广每个国家/地区代码使用一个文件的另一种方法(如安德鲁怀特(Andrew White)和PJ_Finnegan的回答中所述)是仅定义一次HTML(例如,在TextUtil文件夹中),并在其中使用TextView ID,例如string/message_text将资产加载到字符串中后,您可以…

每个国家/地区代码使用一个文件的另一种方法(如安德鲁·怀特(Andrew White)和PJ_Finnegan的回答中所述)是仅定义一次HTML(例如,在TextUtil文件夹中),并在其中使用TextView ID,例如

@string/message_text

将资产加载到字符串中后,您可以将其内容传递给TextUtil:

/**

* Regex that matches a resource string such as @string/a-b_c1.

*/

private static final String REGEX_RESOURCE_STRING = "@string/([A-Za-z0-9-_]*)";

/** Name of the resource type "string" as in @string/... */

private static final String DEF_TYPE_STRING = "string";

/**

* Recursively replaces resources such as @string/abc with

* their localized values from the app's resource strings (e.g.

* strings.xml) within a source string.

*

* Also works recursively, that is, when a resource contains another

* resource that contains another resource, etc.

*

* @param source

* @return source with replaced resources (if they exist)

*/

public static String replaceResourceStrings(Context context, String source) {

// Recursively resolve strings

Pattern p = Pattern.compile(REGEX_RESOURCE_STRING);

Matcher m = p.matcher(source);

StringBuffer sb = new StringBuffer();

while (m.find()) {

String stringFromResources = getStringByName(context, m.group(1));

if (stringFromResources == null) {

Log.w(Constants.LOG,

"No String resource found for ID \"" + m.group(1)

+ "\" while inserting resources");

/*

* No need to try to load from defaults, android is trying that

* for us. If we're here, the resource does not exist. Just

* return its ID.

*/

stringFromResources = m.group(1);

}

m.appendReplacement(sb, // Recurse

replaceResourceStrings(context, stringFromResources));

}

m.appendTail(sb);

return sb.toString();

}

/**

* Returns the string value of a string resource (e.g. defined in

* values.xml).

*

* @param name

* @return the value of the string resource or null if no

* resource found for id

*/

public static String getStringByName(Context context, String name) {

int resourceId = getResourceId(context, DEF_TYPE_STRING, name);

if (resourceId != 0) {

return context.getString(resourceId);

} else {

return null;

}

}

/**

* Finds the numeric id of a string resource (e.g. defined in

* values.xml).

*

* @param defType

* Optional default resource type to find, if "type/" is not

* included in the name. Can be null to require an explicit type.

*

* @param name

* the name of the desired resource

* @return the associated resource identifier. Returns 0 if no such resource

* was found. (0 is not a valid resource ID.)

*/

private static int getResourceId(Context context, String defType,

String name) {

return context.getResources().getIdentifier(name, defType,

context.getPackageName());

}

这种方法的好处是,您只需指定一次HTML的结构,然后使用android的本地化机制。 另外,它允许递归引用strings.xml中的字符串,TextUtil不支持。例如:

Some string @string/another_one.

缺点是解析是在运行时完成的,因此在应用程序中使用每种语言时,为每种语言指定专用的HTML会有更好的性能。

有关使用此代码将HTML从资产文件转换为可在TextView中显示的“可样式化” TextUtil(使用Kuitsi的TagHandler)的示例,请参见TextUtil。

http://www.lbrq.cn/news/2527417.html

相关文章:

  • 淘宝客15套单页网站程序模板打包百度一下你就知道了官网
  • 深圳外贸建站网络推广联客易华夏思源培训机构官网
  • 网站设计欣赏襄阳网站推广优化技巧
  • 网站建设 考虑做seo网页价格
  • 江苏天矗建设集团网站品牌策略有哪些
  • 个人网站开发如何赚钱手机建站系统
  • 永久一级传奇网站网络推广比较经典和常用的方法有
  • 网站公告设计专业海外网站推广
  • 自己做的网站本地虚拟上传一个产品的网络营销方案
  • 个人网站制作网站天津seo推广
  • 中国建设银行泗水支行的网站营销网站定制
  • 如何通过axure做网站手机网站快速建站
  • 陕西网站建设公司哪有太原免费网站建站模板
  • 乌鲁木齐公司网站建设做seo如何赚钱
  • 用自建网站做外贸百度账号怎么注销
  • 自己做的网站怎么绑定域名做一个公司网页多少钱
  • 做网站的网站源码电商推广联盟
  • 网站说服力百度推广登录官网入口
  • 政协网站 是政协信息化建设电脑培训班有哪些科目
  • 淄博哪家公司做网站最好所有代刷平台推广
  • 网站建设合同的性质优化大师电脑版官网
  • 网站维护和制作怎么做会计分录google站长工具
  • 平面设计大赛网站爱网
  • 制作小程序营销平台seo咨询河北
  • 北海做网站哪家好小红书信息流广告
  • 评论 wordpress免费培训seo
  • 宁波网站设计建站服务公司建站工具有哪些
  • 企业建设网站有哪些网站优化软件
  • 投票网站制作单词优化和整站优化
  • 重生主角做视频网站的小说湖南网站推广优化
  • 如何快速部署主数据管理解决方案?
  • 深入理解 Slab / Buddy 分配器与 MMU 映射机制
  • Leetcode-3152 特殊数组 II
  • 车载刷写架构 --- 刷写思考扩展
  • 创建型设计模式-工厂方法模式和抽象工厂方法模式
  • 电脑没有声音了怎么恢复 快速解决音频故障