Activity:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
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="com.example.top4.MainActivity" > <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world" /> </RelativeLayout>

JAVA:

View view=getLayoutInflater().inflate(R.layout.activity_main,null);
//定义一个Toast
Toast ts=new Toast(this);
//将该Tosat输出到 View
ts.setView(view);
//设置Toast时间
ts.setDuration();
//设置Tost的位置
ts.setGravity(Gravity.BOTTOM|Gravity.RIGHT,,);
//最后要记得加.show();不加就不会显示
ts.show();

最新文章

  1. Textbox.Visible=False隐藏方式导致的问题
  2. Reverse-Daily(2)-wow
  3. LINUX常用配置及命令
  4. IntelliJ IDEA 中集成使用git(2015年06月10日)
  5. js图片旋转
  6. 常用数据字典---bai
  7. symfony配置
  8. HBase API详解
  9. My网页
  10. webservice整合spring
  11. [JLOI2014] 松鼠的新家
  12. Dynamics CRM2011/2013 删除个人视图
  13. P4013 数字梯形问题 网络流
  14. luoguP1919 A*B Problem升级版 ntt
  15. PL/SQL学习笔记之数据类型中的标量、LOB
  16. Effective Java通用设计
  17. Azure ARM (22) 使用Azure PowerShell创建Azure RM VM
  18. nginx-https错误
  19. npm的用户名添加不上的原因
  20. PHP &#183; MySQL函数

热门文章

  1. [bzoj1582][Usaco2009 Hol]Holiday Painting 节日画画_线段树
  2. codevs——1979 第K个数
  3. MYSQL中有关表的简单操作
  4. 9、Java并发性和多线程-线程安全与共享资源
  5. mysql模糊查询语句
  6. ubuntu How do I configure proxies without GUI?
  7. How to Use DHCP Relay over LAN? - DrayTek Corp
  8. HDU 1248寒冰王座-全然背包或记忆化搜索
  9. error: &amp;#39;Can&amp;#39;t connect to local MySQL server through socket &amp;#39;/var/lib/mysql/mysql.sock&amp;#39; (2)&amp;#39;
  10. Oracle 用户管理(二)