`
xindrace
  • 浏览: 93788 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论
文章列表
引用 环境:Winxp+VC6.0过程:编绎生成Dll文件时出错 首先是关于dll文件的生成:方法如下:打开VC++6.0,新建->; 工程 ->; win32 Dynamic-Link Library在向导中选择空工程添加如用javah生成的头文件和自己写的一个cpp文件,然后编译运行,如果没有出现错误,既可以在编译成功的debug文件夹中找到dll文件,如果出现找不到jni.h的错误,那么用如下方法解决:fatal error C1083: Cannot open include file: 'jni.h': No such file or directory 引用   ...
public void onFocusChange(View v, boolean hasFocus) { // 需要每次来这个界面的时候EditText.clearFocus() if (v.getId() == R.id.fl_search_content) {// 解决EditText在tabactivity中使用多个view切换不弹出软键盘 if (hasFocus == true) { ((InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE)) .showSoft ...
首先在styles.xml添加如下的自定义样式: <style name="mycheckbox" parent="@android:style/Widget.CompoundButton.CheckBox"> <item name="android:button">@drawable/my_checkbox</item> </style>  my_checkbox.xml的内容为: <?xml version="1.0" encoding=&quo ...
有时候android系统提供给我们的ratingbar效果并不达到我们的要求,这个时候就可以自定义自己喜欢的ratingbar。 从上面的效果可以看出,自定义这样的组件,需要两张图片: 。一张用来未选择的效果,一张用来显示的效果。那还要中间那种一半是未选择一半时选择的呢?其实当你写好这样的组件后,系统就会自动帮你自动解析生成那种效果。 整个项目布局: 我们一步一步来分析: <RatingBar style="@style/roomRatingBar" android:layout_marginLeft="10dip" ...
main.xml <?xml version="1.0" encoding="utf-8"?> <TabHost xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/tabhost" android:layout_width="fill_parent" android:layout_height="fill_parent&q ...
int[] location = new  int[2] ;view.getLocationInWindow(location); //获取在当前窗口内的绝对坐标view.getLocationOnScreen(location);//获取在整个屏幕内的绝对坐标location [0]--->x坐标,location [1]--->y坐标如果在Activity的OnCreate()事件输出那些参数,是全为0,要等UI控件都加载完了才能获取到这些。 在onWindowFocusChanged(boolean hasFocus)中获取为好

手势识别

[功能] 何为手势识别? 比如:你在屏幕上从左至右划出的一个动作 这就是手势 能够识别这个的就是 手势识别 [思路] 1. android 有一个手势识别的类:OnGestureListener 2. 在 GestureDetector() 中使用上面的class 即可 系统就会把手势交由该类来处理 public class SampleGuest implements OnGestureListener { Activity activity; public SampleGuest(Activity a){ ...
/** * 根据手机的分辨率从 dp 的单位 转成为 px(像素) */ public static int dip2px(Context context, float dpValue) { final float scale = context.getResources().getDisplayMetrics().density; return (int) (dpValue * scale + 0.5f); } /** * 根据手机的分辨率从 px(像素) 的单位 转成为 dp */ public static int px2dip(Context con ...
//获取屏幕长宽 WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); wm.getDefaultDisplay().getHeight(); wm.getDefaultDisplay().getWidth(); //获取status bar高度 View rootView = view.getRootView(); Rect r = new Rect(); rootView.getWindowVisibleDisp ...
1 android 动画 1.1动画结构图   Android动画 Animation(2D) openGL(3D) Tween Frame                           1.2动画相关类                              1.2.1 Animation 类及其子类 Animation 类及其子类实现了各种动画效果,如平移、缩 放、旋转、改变透明度等。 Animation 是基类,他记录了动画的通用属性 ...

android学习笔记

1 获取屏幕的宽和高1)getWindowManager().getDefaultDisplay().getWidth();     getWindowManager().getDefaultDisplay().getHeight();2)((WindowManager) getSystemService(WINDOW_SERVICE) .getDefaultDisplay().getWidth();     ((WindowManager) getSystemService(WINDOW_SERVICE) .getDefaultDisplay().getHeight();2 加载Animati ...
前几天我的教程里给出了一个作业,改变 ProgressBar 样式颜色。在这里分享一下源码。改变ProgressBar 的样式颜色,可以改变其背景颜色,也可以设置不同的图片。先上两个效果图: (进度条是 自定义图片)(进度条是 自定义颜色)   一.修改背景为图片。 1.我自己制作了两张图片(如下图),并将它们放到工程的 /res/drawable 目录下。
本文来自http://blog.csdn.net/hellogv/   接下来本文要讲的是RelativeLayout、FrameLayout。         RelativeLayout是一个按照相对位置排列的布局,跟AbsoluteLayout这个绝对坐标布局是个相反的理解。               在RelativeLayout布局里的控件包含丰富的排列属性:        Layout above:选择ID A,则该控件在A控件的上方, Layout below、Layout to left of。。。。等同样用法。使用 RelativeLayout布局的 ...
今天的这段代码是网上找的,自己做了些小改,通过模拟器测试。文件下载进度条控制(就是为了高清壁纸加个进度条),自己研究了好久,但是进度条只能显示缓存写入文件的进度,不能显示下载进度。找了好久,终于找到一 ...
 这里介绍一个主要的方法,也是从网上找的,在此整理出来。。。以备不时之需 /** * 将图片设置为圆角 */ public static Bitmap toRoundCorner(Bitmap bitmap, int pixels) { Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Config.ARGB_8888); Canvas canvas = new Canvas(output); final int color = 0xff424242; fina ...
Global site tag (gtag.js) - Google Analytics