在很多android的应用程序中,我们经常可以看到圆角的文本编辑框,那是怎么实现的呢?就像下图这种:
解决方案来自于CSDN问答,以下只是其中一种,更多方法见http://ask.csdn.net/questions/885
需要两个shape绘制文件
对于顶部的EditText,调用这个,top_edittext_bg:
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <solid android:color="#e2e2e2" > </solid> <corners android:radius="1dp" android:bottomLeftRadius="0.1dp" android:bottomRightRadius="0.1dp" android:topLeftRadius="5dp" android:topRightRadius="5dp" > </corners> </shape>
对于中间的EditText,调用这个,bottom_edittext_bg:
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <solid android:color="#e2e2e2" > </solid> <corners android:radius="1dp" android:bottomLeftRadius="5dp" android:bottomRightRadius="5dp" android:topLeftRadius="0.1dp" android:topRightRadius="0.1dp" > </corners> </shape>然后设置这个在android:background="@drawable/RESPECTIVE_XMLS"属性给相关联的EditText's
今天一同事提交修改时遇见了这个问题
[root@root src] # svn ci Makefile –m “settime” svn: The log message is a pathname (was -F intended?); use '--force-log' to override
当提交时出现了上面的错误,大意是log信息与一个文件名相同,使用“--force-log”选项强制执行此命令。
其实这个错误时应为log信息和当前文件夹下一个文件的名字相同造成的,随便修改下-m的信息就行了,如下
[root@root src]# svn ci Makefile –m “settime123-” Sending Makefile Transmitting file data . Committed revision 60.
---------------- 成功了!
1. maven 配置
<!-- Spring Json -->
<dependency>
<groupId>net.sf.spring-json</groupId>
<artifactId>spring-json</artifactId>
<version>1.3.1</version>
<exclusions>
<exclusion>
<artifactId>sojo-optional</artifactId>
<groupId>net.sf.sojo</groupId>
</exclusion>
<exclusion>
<artifactId>spring-mock</artifactId>
<groupId>org.springframework</groupId>
</exclusion>
<exclusion>
<artifactId>spring</artifactId>
<groupId>org.springframework</groupId>
</exclusion>
<exclusion>
<artifactId>servlet-api</artifactId>
<groupId>javax.servlet</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>net.sf.sojo</groupId>
<artifactId>sojo</artifactId>
<version>1.0.5</version>
<exclusions>
<exclusion>
<artifactId>commons-attributes-api</artifactId>
<groupId>commons-attributes</groupId>
</exclusion>
</exclusions>
</dependency>
2. 我们要在WEB-INF下面添加views.xml
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util" xsi:schemaLocation= "http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd"> <bean name="jsonView" /> </beans>
<!-- json --> <bean id="xmlFileViewResolver" > <property name="location"> <value>/WEB-INF/views.xml</value> </property> <property name="order"> <value>1</value> </property> </bean>
3.在ModelAndView 的后面,我们只要添加
return new ModelAndView("jsonView", modelMap);
就好了
提供一个简单的Sample
public ModelAndView getColumnsJson(HttpServletRequest request, HttpServletResponse response) throws Exception { Map<String,Object> modelMap = new HashMap<String,Object>(2); modelMap.put("rows", service.generateColumns()); return new ModelAndView("jsonView", modelMap); }
已有 0 人发表留言,猛击->>这里<<-参与讨论
ITeye推荐
- —软件人才免语言低担保 赴美带薪读研!—