html仿ios
① 急求html 自定義滾動條,仿iphone特效
一流素材網和懶人圖庫上有這樣的js特效
② 【html5模仿ios滾輪控制項】幫我修改這個JS的傳值部分
你好厲害啊。膜拜···
③ 如何通過 HTML5 實現 iOS 7 的實時毛玻璃模糊效果
首先看效果:
要想通過HTML5實現IOS7的毛玻璃模糊效果需要用代碼來執行
//加模糊效果,image是圖片,blur是模糊度
- (UIImage *)blurryImage:(UIImage *)image withBlurLevel:(CGFloat)blur {
//模糊度,
if ((blur < 0.1f) || (blur > 2.0f)) {
blur = 0.5f;
}
//boxSize必須大於0
int boxSize = (int)(blur * 100);
boxSize -= (boxSize % 2) + 1;
NSLog(@"boxSize:%i",boxSize);
//圖像處理
CGImageRef img = image.CGImage;
//需要引入#import <Accelerate/Accelerate.h>
/*
This document describes the Accelerate Framework, which contains C APIs for vector and matrix math, digital signal processing, large number handling, and image processing.
本文檔介紹了Accelerate Framework,其中包含C語言應用程序介面(API)的向量和矩陣數學,數字信號處理,大量處理和圖像處理。
*/
//圖像緩存,輸入緩存,輸出緩存
vImage_Buffer inBuffer, outBuffer;
vImage_Error error;
//像素緩存
void *pixelBuffer;
//數據源提供者,Defines an opaque type that supplies Quartz with data.
CGDataProviderRef inProvider = CGImageGetDataProvider(img);
// provider』s data.
CFDataRef inBitmapData = CGDataProviderCopyData(inProvider);
//寬,高,位元組/行,data
inBuffer.width = CGImageGetWidth(img);
inBuffer.height = CGImageGetHeight(img);
inBuffer.rowBytes = CGImageGetBytesPerRow(img);
inBuffer.data = (void*)CFDataGetBytePtr(inBitmapData);
//像數緩存,位元組行*圖片高
pixelBuffer = malloc(CGImageGetBytesPerRow(img) * CGImageGetHeight(img));
outBuffer.data = pixelBuffer;
outBuffer.width = CGImageGetWidth(img);
outBuffer.height = CGImageGetHeight(img);
outBuffer.rowBytes = CGImageGetBytesPerRow(img);
// 第三個中間的緩存區,抗鋸齒的效果
void *pixelBuffer2 = malloc(CGImageGetBytesPerRow(img) * CGImageGetHeight(img));
vImage_Buffer outBuffer2;
outBuffer2.data = pixelBuffer2;
outBuffer2.width = CGImageGetWidth(img);
outBuffer2.height = CGImageGetHeight(img);
outBuffer2.rowBytes = CGImageGetBytesPerRow(img);
//Convolves a region of interest within an ARGB8888 source image by an implicit M x N kernel that has the effect of a box filter.
error = vImageBoxConvolve_ARGB8888(&inBuffer, &outBuffer2, NULL, 0, 0, boxSize, boxSize, NULL, kvImageEdgeExtend);
error = vImageBoxConvolve_ARGB8888(&outBuffer2, &inBuffer, NULL, 0, 0, boxSize, boxSize, NULL, kvImageEdgeExtend);
error = vImageBoxConvolve_ARGB8888(&inBuffer, &outBuffer, NULL, 0, 0, boxSize, boxSize, NULL, kvImageEdgeExtend);
if (error) {
NSLog(@"error from convolution %ld", error);
}
// NSLog(@"位元組組成部分:%zu",CGImageGetBitsPerComponent(img));
//顏色空間DeviceRGB
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
//用圖片創建上下文,CGImageGetBitsPerComponent(img),7,8
CGContextRef ctx = CGBitmapContextCreate(
outBuffer.data,
outBuffer.width,
outBuffer.height,
8,
outBuffer.rowBytes,
colorSpace,
CGImageGetBitmapInfo(image.CGImage));
//根據上下文,處理過的圖片,重新組件
CGImageRef imageRef = CGBitmapContextCreateImage (ctx);
UIImage *returnImage = [UIImage imageWithCGImage:imageRef];
//clean up
CGContextRelease(ctx);
CGColorSpaceRelease(colorSpace);
free(pixelBuffer);
free(pixelBuffer2);
CFRelease(inBitmapData);
CGColorSpaceRelease(colorSpace);
CGImageRelease(imageRef);
return returnImage;
}
這里要注意的是以上的代碼會有崩潰的情況
崩潰log:Assertion failed: (!space->is_singleton), function color_space_dealloc, file ColorSpaces/color-space
可以用如下方式來實現
- (UIImage*)applyBlurRadius:(CGFloat)radius toImage:(UIImage*)image
{
if(radius < 0) radius = 0;
CIContext*context = [CIContextcontextWithOptions:nil];
CIImage*inputImage = [CIImageimageWithCGImage:image.CGImage];
// Setting up gaussian blur
CIFilter*filter = [CIFilterfilterWithName:@"CIGaussianBlur"];
[filtersetValue:inputImageforKey:kCIInputImageKey];
[filtersetValue:[NSNumbernumberWithFloat:radius]forKey:@"inputRadius"];
CIImage*result = [filtervalueForKey:kCIOutputImageKey];
CGImageRefcgImage = [contextcreateCGImage:resultfromRect:[inputImageextent]];
UIImage*returnImage = [UIImageimageWithCGImage:cgImage];
CGImageRelease(cgImage);
returnreturnImage;
}
④ 高仿的iPhone自帶仿iOS的安卓5.1 想刷成mui 或者 Flyme的系統 怎麼樣刷機
可以試試Kingroot,一鍵root,或者是root精靈。
或者是直接利用救磚程序刷一遍,再換其他系統。
⑤ 求一款仿蘋果桌面的軟體,忘記叫我什麼名字了!
http://www.skycn.com/soft/44217.html#downUrlMap 本程序可以在幾秒鍾內將XP的界面轉換到精美的蘋果機樣式。你只需要點擊一次按鈕,本程序就可以將XP的各種界面元素,如窗口外觀(可視風格)、系統圖標、滑鼠指針、系統聲音、登陸畫面、桌面壁紙以及Doc快捷工具欄完全改變成為蘋果機樣式,讓您在XP下也能體驗蘋果機的超炫界面!
⑥ 請問高仿手機 能仿出蘋果的IOS系統嗎 有的說能仿蘋果的IOS一模一樣
絕無可能,奸商嘴裡所謂的一模一樣,其實也就是把安卓界面貼圖換成iOS一樣而已,iOS的軟體它照樣一個都不能用。
如果那些人真的有那麼厲害的技術能自己做一個跟正品iOS一模一樣的操作系統出來,他們也沒必要做山寨機了
⑦ 網上那些高仿蘋果是怎麼弄的,修改ROM么怎麼讓安卓變成仿蘋果
安卓機不能刷蘋果系統。
至於高仿,你可以通過幾款軟體來實現
ilauncher
inoty
isetting
......
⑧ 如何實現網頁代碼(JS/HTML)和IOS應用程序交互
//①ji與android交互
//js調用android方法
window.類.方法名稱(參數1,參數2);
//android調用js方法(loginIn:方法名稱,uname:參數)
//activity.loadUrl("javascript:loginIn('"+uname+"');");
//②js與ios交互
//js調用ios方法(objc:協議)
window.location.href='objc://方法名稱|參數1|參數2';
//ios調用js方法:
同android
其中:android的activity如下:
@Override
publicvoidonCreate(BundlesavedInstanceState){
//setFullScreen(true);
Intentintent=newIntent(getApplicationContext(),
SplashActivity.class);
startActivity(intent);
super.onCreate(savedInstanceState);
super.init();
//Setby<contentsrc="index.html"/>inconfig.xml
activity=this;
//this.appView.setBackgroundResource(R.drawable.welcome);//設置背景圖片
//
//super.setIntegerProperty("splashscreen",R.drawable.welcome);
//設置閃屏背景圖片
//super.setBooleanProperty(name,value)
//super.loadUrl("這里是html頁面的路徑");
super.appView.addJavascriptInterface(newFu(),"這里是類名(js中需要通過這個類名訪問android方法)");
super.loadUrl(Config.getStartUrl());
//super.loadUrl("file:///android_asset/www/index.html")
//mController.openShare(activity,false);
//try{
//getToken();
//}catch(NoSuchAlgorithmExceptione){
////TODOAuto-generatedcatchblock
////e.printStackTrace();
//}
}
⑨ 仿ios的懸浮窗查看最近應用怎麼不能用
在一些場合里,我們使用懸浮窗會有很大的便利,比如IOS系統的懸浮窗,360或者其他手機衛士的懸浮窗等等。
我們創造出兩個懸浮窗,通過點擊小懸浮窗打開或者關閉大懸浮窗。
代碼如下:
在這之前,我們需要在manifest中申請許可權:
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
1
並且,懸浮窗這個許可權我們需要手動在手機找到應用許可權管理,允許這個許可權才行
小懸浮窗的界面代碼float_normal_view.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/ll_float_normal"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="@+id/iv_show_control_view"
android:layout_gravity="center"
android:background="@drawable/float_bg"
android:layout_width="65dp"
android:orientation="vertical"
android:alpha="0.3"
android:layout_height="65dp" >
</ImageView>
</LinearLayout>
大懸浮窗的界面代碼float_window_big.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="/apk/res/android"
android:id="@+id/big_window_layout"
android:layout_width="200dip"
android:layout_height="100dip"
android:background="@android:color/holo_green_dark"
android:orientation="vertical"
>
<Button
android:id="@+id/close"
android:layout_width="100dip"
android:layout_height="40dip"
android:layout_gravity="center_horizontal"
android:layout_marginTop="12dip"
android:text="關閉懸浮窗"
/>
<Button
android:id="@+id/back"
android:layout_width="100dip"
android:layout_height="40dip"
android:layout_gravity="center_horizontal"
android:text="主頁"
/>
</LinearLayout>
入口activity(MainActivity ):
public class MainActivity extends Activity {
MyWindowManager myWindowManager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if(!Settings.canDrawOverlays(getApplicationContext())) {
//啟動Activity讓用戶授權
Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION);
intent.setData(Uri.parse("package:" + getPackageName()));
startActivityForResult(intent,100);
}
}
setContentView(R.layout.activity_main);
myWindowManager = MyWtijian.scykxy.cn#indowManager.getInstance();
myWindowManager.createNormalView(this.getApplicationContext());
}
}
懸浮窗管理器MyWindowManager:
public class MyWindowManager {
private FloatNormalView normalView;
private Context mContext;
private static MyWindowManager instance;
private WindowManager windowManager;
private MyWindowManager() {
}
public static MyWindowManager getInstance() {
if (instance == null)
instance = new MyWindowManager();
return instance;
}
private WindowManager getWindowManager(Context context) {
if (windowManager == null)
windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
mContext=context;
return windowManager;
}
/**
* 判斷小懸浮窗是否存在
*
* @return
*/
public boolean isNormalViewExists() {
return normalView != null;
}
/**
* 創建小型懸浮窗
*/
public void createNormalView(Context context) {
if (normalView == null) {
normalView = new FloatNormalView(context);
}
}
/**
* 移除懸浮窗
*
* @param context
*/
public void removeNormalView(Context context) {
if (normalView != null) {
windowManager.removeView(normalView);
normalView = null;
}
}
FloatWindowBigView bigWindow;
private WindowManager.LayoutParams bigWindowParams;
public void createBigWindow(Context context) {
WindowManager windowManager = getWindowManager(context);
int screenWidth = windowManager.getDefaultDisplay().getWidth();
int screenHeight = windowManager.getDefaultDisplay().getHeight();
if (bigWindow == null) {
bigWindow = new FloatWindowBigView(context);
if (bigWindowParams == null) {
bigWindowParams = new WindowManager.LayoutParams();
bigWindowParams.x = screenWidth / 2 - FloatWindowBigView.viewWidth / 2;
bigWindowParams.y = screenHeight / 2 - FloatWindowBigView.viewHeight / 2;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
bigWindowParams.type =WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
}
else {
bigWindowParams.type = WindowManager.LayoutParams.TYPE_PHONE;
}
bigWindowParams.format = PixelFormat.RGBA_8888;
bigWindowParams.gravity = Gravity.LEFT | Gravity.TOP;
bigWindowParams.width = FloatWindowBigView.viewWidth;
bigWindowParams.height = FloatWindowBigView.viewHeight;
}
windowManager.addView(bigWindow, bigWindowParams);
}
}
public void removeBigWindow(Context context) {
if (bigWindow != null) {
WindowManager windowManager = getWindowManager(context);
windowManager.removeView(bigWindow);
bigWindow = null;
}
}
}
小懸浮窗FloatNormalView:
public class FloatNormalView extends LinearLayout implements View.OnTouchListener {
private final static String TAG="FloatNormalView";
/**
* 記錄小懸浮窗的寬度
*/
public static int viewWidth;
/**
* 記錄小懸浮窗的高度
*/
public static int viewHeight;
/**
* 記錄系統狀態欄的高度
*/
private static int statusBarHeight;
/**
* 用於更新小懸浮窗的位置
*/
private WindowManager windowManager;
/**
* 小懸浮窗的參數
*/
private WindowManager.LayoutParams mParams;
/**
* 記錄當前手指位置在屏幕上的橫坐標值
*/
private float xInScreen,xInitScreen;
/**
* 記錄當前手指位置在屏幕上的縱坐標值
*/
private float yInScreen,yInitScreen;
/**
* 記錄手指按下時在屏幕上的橫坐標的值
*/
private float xDownInScreen;
/**
* 記錄手指按下時在屏幕上的縱坐標的值
*/
private float yDownInScreen;
/**
* 記錄手指按下時在小懸浮窗的View上的橫坐標的值
*/
private float xInView;
/**
* 記錄手指按下時在小懸浮窗的View上的縱坐標的值
*/
private float yInView;
public FloatNormalView(Context context) {
super(context);
windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
LayoutInflater.from(context).inflate(R.layout.float_normal_view, this);
View view = findViewById(R.id.ll_float_normal);
viewWidth = view.getLayoutParams().width;
viewHeight = view.getLayoutParams().height;
initLayoutParams();
}
OnClickListener circleClickListener=new OnClickListener() {
@Override
public void onClick(View view) {
MyWindowManager.getInstance().createBigWindow(getContext());
MyWindowManager.getInstance().removeNormalView(getContext());
}
};
/**
* 初始化參數
*/
private void initLayoutParams() {
//屏幕寬高
int screenWidth = windowManager.getDefaultDisplay().getWidth();
int screenHeight = windowManager.getDefaultDisplay().getHeight();
mParams = new WindowManager.LayoutParams();
// FLAG_NOT_TOUCH_MODAL不阻塞事件傳遞到後面的窗口
// FLAG_NOT_FOCUSABLE 懸浮窗口較小時,後面的應用圖標由不可長按變為可長按,不設置這個flag的話,home頁的劃屏會有問題
mParams.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
| WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL;
//懸浮窗默認顯示的位置
mParams.gravity = Gravity.START | Gravity.TOP;
//指定位置
mParams.x = screenWidth - viewWidth * 2;
mParams.y = screenHeight / 2 + viewHeight * 2;
//懸浮窗的寬高
mParams.width = WindowManager.LayoutParams.WRAP_CONTENT;
mParams.height = WindowManager.LayoutParams.WRAP_CONTENT;
mParams.format = PixelFormat.TRANSPARENT;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
mParams.type =WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
}
else {
mParams.type = WindowManager.LayoutParams.TYPE_PHONE;
}
mParams.type = WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
windowManager.addView(this, mParams);
}
@Override
public boolean onTouchEvent(MotionEvent event) {
Log.i(TAG,"hsz--->onTouchEvent:"+event.getAction());
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
// 手指按下時記錄必要數據,縱坐標的值都需要減去狀態欄高度
xInView =xInitScreen= event.getX();
yInView =yInitScreen= event.getY();
xDownInScreen = event.getRawX();
yDownInScreen = event.getRawY() - getStatusBarHeight();
xInScreen = event.getRawX();
yInScreen = event.getRawY() - getStatusBarHeight();
break;
case MotionEvent.ACTION_MOVE:
xInScreen = event.getRawX();
yInScreen = event.getRawY() - getStatusBarHeight();
// 手指移動的時候更新小懸浮窗的位置
updateViewPosition();
break;
case MotionEvent.ACTION_UP:
// 如果手指離開屏幕時,xDownInScreen和xInScreen相等,且yDownInScreen和yInScreen相等,則視為觸發了單擊事件。
if (xDownInScreen == xInScreen && yDownInScreen == yInScreen) {
openOrCloseControlView();
}
Float distanceX=event.getX()-xInitScreen;
Float distanceY=event.getY()-yInitScreen;
if(distanceX==0 && distanceY==0){
MyWindowManager.getInstance().createBigWindow(getContext());
MyWindowManager.getInstance().removeNormalView(getContext());
}
break;
default:
break;
}
return true;
}
/**
* 將小懸浮窗的參數傳入,用於更新小懸浮窗的位置。
*
* @param params 小懸浮窗的參數
*/
public void setParams(WindowManager.LayoutParams params) {
mParams = params;
}
/**
* 更新小懸浮窗在屏幕中的位置。
*/
private void updateViewPosition() {
mParams.x = (int) (xInScreen - xInView);
mParams.y = (int) (yInScreen - yInView);
windowManager.updateViewLayout(this, mParams);
}
/**
* 用於獲取狀態欄的高度。
*
* @return 返回狀態欄高度的像素值。
*/
private int getStatusBarHeight() {
if (statusBarHeight == 0) {
try {
Class<?> c = Class.forName("com.android.internal.R$dimen");
Object o = c.newInstance();
Field field = c.getField("status_bar_height");
int x = (Integer) field.get(o);
statusBarHeight = getResources().getDimensionPixelSize(x);
} catch (Exception e) {
e.printStackTrace();
}
}
return statusBarHeight;
}
@Override
public boolean onTouch(View v, MotionEvent event) {
return false;
}
}
大懸浮窗FloatWindowBigView:
public class FloatWindowBigView extends LinearLayout {
/**
* 記錄大懸浮窗的寬度
*/
public static int viewWidth;
/**
* 記錄大懸浮窗的高度
*/
public static int viewHeight;
public FloatWindowBigView(final Context context) {
super(context);
LayoutInflater.from(context).inflate(R.layout.float_window_big, this);
View view = findViewById(R.id.big_window_layout);
viewWidth = view.getLayoutParams().width;
viewHeight = view.getLayoutParams().height;
Button close = (Button) findViewById(R.id.close);
Button back = (Button) findViewById(R.id.back);
close.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// 點擊關閉懸浮窗的時候
MyWindowManager.getInstance().removeBigWindow(context);
MyWindowManager.getInstance().createNormalView(context);
}
});
back.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// 點擊主頁的時候,移除大懸浮窗,創建小懸浮窗
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.addCategory(Intent.CATEGORY_HOME);
context.startActivity(intent);
MyWindowManager.getInstance().removeBigWindow(context);
MyWindowManager.getInstance().createNormalView(context);
}
});
}
}