1. android EditText输入文字 数字时 里面的图片文字怎么消失 用的是哪个属性
你说的是在EditText有个水印,输入的时候水印消失的效果吧?你再EditText的XML中加入android:hint=“请输入用户名”,运行时EditText就会有一个“请输入用户名”的水印,当你输入任何字符时,水印消失,删除所有字符后水印又会出来,你还可以用android:textColorHint="颜色值"来设置水印文字的颜色哦。在java代码中可以使用对应的方法实现这些功能,分别是
setHint(水印文字)和setHintTextColor(颜色值)
2. 在android中的xml里怎么布置在一个图片上显示文字
可以用FrameLayout来实现。在FrameLayout控件中用ImageView和TextView就能实现上面的效果。(RelativeLayout也能实现,方法和FrameLayout基本一样)
3. android在一张图片相应位置显示字的布局
1、在一张图片的任意位置显示文字,使用RelativeLayout布局,俗称相对布局,是在Android开发中使用得最多的一种布局方式,比如在图片的下边栏显示一行文字,代码如下:
<ImageView
android:id="@+id/imageview_001"
android:layout_width="match_parent"
android:layout_height="120dp"
android:layout_alignParentTop="true"
android:src="@drawable/ic_launcher"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="20dp"
android:layout_marginTop="100dp"
/>
更多Android例子,网络一下就知道了,平时也做点学习,TeachCourse比较适合初学者,谢谢采纳!
4. 我刚学Android不久,用系统自带的Menu,加了图片后怎么没显示出来
菜单Memu是用户界面中最常见的元素之一,使用非常频繁,在Android中,菜单被分为如下三种,选项菜单(OptionsMenu)、上下文菜单(ContextMenu)和子菜单(SubMenu),以下说的是创建OptionsMenu
一、概述
public boolean onCreateOptionsMenu(Menu menu):使用此方法调用OptionsMenu。
public boolean onOptionsItemSelected(MenuItem item):选中菜单项后发生的动作。
public void onOptionsMenuClosed(Menu menu):菜单关闭后发生的动作。
public boolean onPrepareOptionsMenu(Menu menu):选项菜单显示之前onPrepareOptionsMenu方法会被调用,你可以用此方法来根据打当时的情况调整菜单。
public boolean onMenuOpened(int featureId, Menu menu):单打开后发生的动作。
二、默认样式
默认样式是在屏幕底部弹出一个菜单,这个菜单我们就叫他选项菜单OptionsMenu,一般情况下,选项菜单最多显示2排每排3个菜单项,这些菜单项有文字有图标,也被称作Icon Menus,如果多于6项,从第六项开始会被隐藏,在第六项会出现一个More里,点击More才出现第六项以及以后的菜单项,这些菜单项也被称作Expanded Menus。下面介绍。
1.main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="请点击 Menu键显示选项菜单" android:id="@+id/TextView02" />
</LinearLayout>
2.重载onCreateOptionsMenu(Menu menu)方法
重载onCreateOptionsMenu(Menu menu)方法,并在此方法中添加菜单项,最后返回true,如果false,菜单则不会显示。
3.为菜单项注册事件
使用onOptionsItemSelected(MenuItem item)方法为菜单项注册事件
public boolean onOptionsItemSelected(MenuItem item)
5. android怎样实现在图片上任意位置添加文字 要代码 急求。。
android在图片上任意位置添加文字,可以使用canvas类进行操作,实例如下:
@Override
protectedvoidonDraw(Canvascanvas)
{
super.onDraw(canvas);
canvas.drawBitmap(m_LogInBmp,null,m_LogIndst,m_txBackPaint);
floattleft=m_LogIndst.left+(m_LogIndst.right-m_LogIndst.left-FontWidth*m_TextLogIn.length())/2;
floatttop=m_LogIndst.top+(m_LogIndst.bottom-m_LogIndst.top-FontHeight)/2+FontHeight;
canvas.drawText(m_TextLogIn,tleft,ttop,mLogInPaint);
}
6. android 怎么点击图片显示文字说明,再点击消失了
添加图片点击事件,在点击之后实现布局上的文字的显示和消失,这个布局可以用frameLayout来实现,将上层的文字啥的先不显示就行了
7. Android Button设置.9格式图片当背景,发现Button的text不显示了
我觉得这个是你画的 .9 图的问题
右边跟下边有画成这样才能显示文字内容,至于为什么,请自行搜索一下.9图的用法
8. 手机上有没有软件可以给图片添加文字
1、ypic
《Typic》是一款帮助你把图片和文字结合起来的App。相比其他同类App,Typic最突出的特点是上手非常容易:将图文合成的操作分步完成,新用户可以专注于当前的操作,不会被其他功能分心。
2、美图秀秀
美图秀秀是2008年10月8日由厦门美图科技有限公司研发、推出的一款免费图片处理的软件,有iPhone版、Android版、PC版、Windows Phone版、iPad版及网页版,致力于为全球用户提供专业智能的拍照、修图服务。
3、天天P图
天天P图为全能实用美图类App,由腾讯出品。包括美化图片、自然美妆、疯狂变妆、魔法抠图等七个模块。简单实用的图片编辑功能,让手机也可轻松制作单反级效果;多款新潮妆容,瞬间打造出精致美颜。
4、玩图
玩图是一款APP,可以让用户制作GIF动画, 还能加滤镜和动态相框, 让呆板的照片瞬间跃然纸上, 让你显得很酷, 与众不同。并且能一键分享到新浪微博, 腾讯微博,人人网3大社区。
5、简图安卓版
简图是一款非常好用的图片处理app,在发送朋友圈的时候总觉得图片太单调无法表达内心的意思,下载简图安卓版app可以为你的图片加上心情文字,操作简单傻瓜式一键操作,打造你的文艺范图片。
9. android 如何像win8图标一样在图片按钮上加文字
可以不使用button控件,而是用布局 ,在布局中定义文字大小位置,而布局大小就是你所谓的按钮大小其背景色就用此图片,最终给这个布局添加上onclick事件就可以了
10. android RadioButton 怎么设置只显示图片不显示图片,因为图片上已经有文字了
只需要给RadioButton配置一个Selector背景选择器即显示图片。
1.创建mylist_view.xml文件
首先在res目录下新建drawable文件夹,再在新建的drawable文件夹中新建mylist_view.xml,其目录结构为:res/drawable/mylist_view.xml。
2.根据具体需求编辑mylist_view.xml文件
新建mylist_view.xml文件后,在没有添加任何属性时其内部代码结构为:
<?xml version="1.0" encoding="utf-8" ?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
</selector>
3.下面就可以根据项目需求,在其内部定义为自己想要的样式了,主要属性如下:
<?xml version="1.0" encoding="utf-8" ?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 默认时的背景图片-->
<item android:drawable="@drawable/pic1" />
<!-- 没有焦点时的背景图片 -->
<item android:state_window_focused="false" android:drawable="@drawable/pic1" />
<!-- 非触摸模式下获得焦点并单击时的背景图片 -->
<item android:state_focused="true" android:state_pressed="true" android:drawable= "@drawable/pic2" />
<!-- 触摸模式下单击时的背景图片-->
<item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/pic3" />
<!--选中时的图片背景-->
<item android:state_selected="true" android:drawable="@drawable/pic4" />
<!--获得焦点时的图片背景-->
<item android:state_focused="true" android:drawable="@drawable/pic5" />
</selector>
4.引用mylist_view.xml文件
android:background="@drawable/mylist_view"