添加源 >
添加源 >
在控制面板里可以看到 SpringBoard Setting,点进去,找到Parllax选件,把里面的Parllax和Blur都打开。这一步完成后已经有动态和玻璃窗效果了,但是稍微卡顿。如果控制面板没有springboard setting,证明缺少插件Mobile Substrate,找到安装,重启。至此,iPhone4就能实现毛玻璃效果了。
注:如果安装上述所有插件后,上拉下拉迟钝,请建议按照第3步进入parllax,然后把parllax关掉,仅剩Blur为打开状态(参照最下面那张中的设置)。另外到Cydia里把HiddenSettings7卸载掉,重启。这样,就可以在实现毛玻璃效果的同时,提高系统流畅度了。
只有越狱才能够去掉
去掉毛玻璃效果
苹果公司创立之初,主要开发和销售的个人电脑,截至2014年致力于设计、开发和销售消费电子、计算机软件、在线服务和个人计算机。苹果的Apple II于1970年代助长了个人电脑革命,其后的Macintosh接力于1980年代持续发展。该公司硬件产品主要是Mac电脑系列、iPod媒体播放器、iPhone智能手机和iPad平板电脑;在线服务包括iCloud、iTunes Store和App Store;消费软件包括OS X和iOS *** 作系统、iTunes多媒体浏览器、Safari网络浏览器,还有iLife和iWork创意和生产力套件。苹果公司在高科技企业中以创新而闻名世界。
1、首先打开苹果手机,点击设置选项,点击进入。2、其次在设置列表中找到通用选项,点击进入,进入后点击键盘一栏。
3、最后在键盘界面点击添加新键盘,将准备好的成毛玻璃键盘选上,点击确定即可。答:因为,毛玻璃也叫雾面玻璃、防眩玻璃等,是用金刚砂等磨过或以化学方法处理过的一种表面粗糙不平整的半透明玻璃,并且,apple是官方标配视听功能的苹果手机,所以,applemusic为苹果手机音乐界面无法使用半透明的毛玻璃;
回答完毕!
如何通过 ToolBar 模拟出的毛玻璃效果。首先我们新建一个工程,工程模板切换到 iOS ,选择 Single View Application ,如下图所示:
点击 Next ,命名任意,Language 选择 Objective-C,如下图所示:
输入完工程名之后,继续点击 Next ,选择一个在你 Mac 上用于存储工程文件的目录完成即可,工程建立好之后开始我们今天的代码之旅。
既然需要模拟的毛玻璃效果,我们首先当然就需要一张,我这里用了一张周杰伦第一张专辑的封面作为本节内容的素材,如下:
接下来,将这张拖动到刚才建立好的工程文件的文件夹 Assetsxcassets 中,如下图所示:
现在点击左侧文件列表选择 ViewControllerm 文件,这时候会在文件列表右侧代码区域显示相关代码,接下来我们书写代码,完成我们今天想要达到的效果。
需要注意的是,以下代码我们需要写在 viewDidLoad 方法中,OK,开始。
第一步,我们首先对进行处理,将添加进 iPhone 界面,并全屏显示。相关代码如下:
创建 UIImageView 对象用于存储,代码如下:
<pre style="font-size:11899999618530273px; line-height:145; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:normal; padding:16px; overflow:auto; background-color:rgb(247,247,247); color:rgb(51,51,51); margin-top:0px!important; margin-bottom:0px!important"><code style="display:inline; overflow:visible; background-color:transparent; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-break:normal; border:0px; line-height:inherit; word-wrap:normal">UIImageView imageView = <span style="color:#999988; font-style:italic">[<span style="">[UIImageView alloc]</span>init]</span>;</code></pre>
设置尺寸占据整个屏幕,代码如下:
<pre style="font-size:11899999618530273px; line-height:145; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:normal; padding:16px; overflow:auto; background-color:rgb(247,247,247); color:rgb(51,51,51); margin-top:0px!important; margin-bottom:0px!important"><code style="display:inline; overflow:visible; background-color:transparent; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-break:normal; border:0px; line-height:inherit; word-wrap:normal">imageViewframe = <span style="font-weight:700">self</span>viewbounds;</code></pre>
指定待显示资源,代码如下:
<pre style="font-size:11899999618530273px; line-height:145; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:normal; padding:16px; overflow:auto; background-color:rgb(247,247,247); color:rgb(51,51,51); margin-top:0px!important; margin-bottom:0px!important"><code style="display:inline; overflow:visible; background-color:transparent; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-break:normal; border:0px; line-height:inherit; word-wrap:normal">imageViewimage = [UIImage <span style="color:#dd1144">imageNamed:</span>@<span style="color:#dd1144">"Jayjpg"</span>];</code></pre>
设置显示模式,代码如下:
<pre style="font-size:11899999618530273px; line-height:145; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:normal; padding:16px; overflow:auto; background-color:rgb(247,247,247); color:rgb(51,51,51); margin-top:0px!important; margin-bottom:0px!important"><code style="display:inline; overflow:visible; background-color:transparent; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-break:normal; border:0px; line-height:inherit; word-wrap:normal">imageViewcontentMode = UIViewContentModeScaleToFill<span style="color:#999988; font-style:italic">;</span></code></pre>
在 iPhone 上显示 image ,代码如下:
<pre style="font-size:11899999618530273px; line-height:145; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:normal; padding:16px; overflow:auto; background-color:rgb(247,247,247); color:rgb(51,51,51); margin-top:0px!important; margin-bottom:0px!important"><code style="display:inline; overflow:visible; background-color:transparent; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-break:normal; border:0px; line-height:inherit; word-wrap:normal"><span style="color:#9900; font-weight:700">[selfview addSubview:imageView]</span><span style="color:#999988; font-style:italic">;</span></code></pre>
先来看一下现在效果如何,运行模拟器,效果如下:
这样我们就将这张添加到了 iPhone ,并进行了全屏显示,由于比例和 iPhone 比例不一致,所以这里略显比例失衡,大家可以找一张比例一致的进行测试,接下来我们看下一步如何制作毛玻璃效果 。
第二步,制作毛玻璃效果,这里我们利用 ToolBar 覆盖在上来模拟毛玻璃的效果,具体 *** 作方法就是先建立一个 ToolBar 对象,然后设置它的尺寸和尺寸一致,即设置为屏幕尺寸,然后覆盖在上即可,相关 *** 作代码如下。
创建 ToolBar 对象,代码如下:
<pre style="font-size:11899999618530273px; line-height:145; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:normal; padding:16px; overflow:auto; background-color:rgb(247,247,247); color:rgb(51,51,51); margin-top:0px!important; margin-bottom:0px!important"><code style="display:inline; overflow:visible; background-color:transparent; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-break:normal; border:0px; line-height:inherit; word-wrap:normal">UIToolbar toolBar = <span style="color:#999988; font-style:italic">[<span style="">[UIToolbar alloc]</span>init]</span>;</code></pre>
设置 ToolBar 尺寸和尺寸一致,代码如下:
<pre style="font-size:11899999618530273px; line-height:145; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:normal; padding:16px; overflow:auto; background-color:rgb(247,247,247); color:rgb(51,51,51); margin-top:0px!important; margin-bottom:0px!important"><code style="display:inline; overflow:visible; background-color:transparent; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-break:normal; border:0px; line-height:inherit; word-wrap:normal">toolBarframe = imageViewbounds<span style="color:#999988; font-style:italic">;</span></code></pre>
设置毛玻璃效果,代码如下:
<pre style="font-size:11899999618530273px; line-height:145; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:normal; padding:16px; overflow:auto; background-color:rgb(247,247,247); color:rgb(51,51,51); margin-top:0px!important; margin-bottom:0px!important"><code style="display:inline; overflow:visible; background-color:transparent; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-break:normal; border:0px; line-height:inherit; word-wrap:normal">toolBarbarStyle = UIBarStyleBlack<span style="color:#999988; font-style:italic">;</span></code></pre>
将 toolBar 添加到上覆盖,代码如下:
<pre style="font-size:11899999618530273px; line-height:145; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:normal; padding:16px; overflow:auto; background-color:rgb(247,247,247); color:rgb(51,51,51); margin-top:0px!important; margin-bottom:0px!important"><code style="display:inline; overflow:visible; background-color:transparent; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-break:normal; border:0px; line-height:inherit; word-wrap:normal"><span style="color:#9900; font-weight:700">[imageView addSubview:toolBar]</span><span style="color:#999988; font-style:italic">;</span></code></pre>
运行模拟器,效果如下:
这是黑色的毛玻璃效果,关于毛玻璃还有一种默认的白色效果,只需将毛玻璃效果设置代码修改为如下代码即可:
<pre style="font-size:11899999618530273px; line-height:145; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:normal; padding:16px; overflow:auto; background-color:rgb(247,247,247); color:rgb(51,51,51); margin-top:0px!important; margin-bottom:0px!important"><code style="display:inline; overflow:visible; background-color:transparent; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-break:normal; border:0px; line-height:inherit; word-wrap:normal">toolBarbarStyle = UIBarStyleDefault<span style="color:#999988; font-style:italic">;</span></code></pre>
运行模拟器,效果如下:
但个人觉得黑色要更加好看一些,所以这里我使用黑色,我将设置代码还原为黑色效果。
现在,已经出现了毛玻璃效果,比较模糊,如果这时候我们在毛玻璃上写字,那么这个字一定会异常清晰,要不要试试看,OK,我们来继续在毛玻璃上面写点字看一下效果,我们就在下方写上这张专辑的名字吧。
第三步,添加文字,相关代码如下。
创建 Label 对象,代码如下:
<pre style="font-size:11899999618530273px; line-height:145; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:normal; padding:16px; overflow:auto; background-color:rgb(247,247,247); color:rgb(51,51,51); margin-top:0px!important; margin-bottom:0px!important"><code style="display:inline; overflow:visible; background-color:transparent; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-break:normal; border:0px; line-height:inherit; word-wrap:normal">UILabel label = <span style="color:#999988; font-style:italic">[<span style="">[UILabel alloc]</span>init]</span>;</code></pre>
设置文字显示位置,代码如下:
<pre style="font-size:11899999618530273px; line-height:145; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:normal; padding:16px; overflow:auto; background-color:rgb(247,247,247); color:rgb(51,51,51); margin-top:0px!important; margin-bottom:0px!important"><code style="display:inline; overflow:visible; background-color:transparent; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-break:normal; border:0px; line-height:inherit; word-wrap:normal">labelframe = CGRectMake(selfviewframesizewidth/<span style="color:teal">2</span>-<span style="color:teal">50</span>, selfviewframesizeheight/<span style="color:teal">2</span>+<span style="color:teal">150</span>, <span style="color:teal">100</span>, <span style="color:teal">100</span>);</code></pre>
设置文字显示颜色为白色,代码如下:
<pre style="font-size:11899999618530273px; line-height:145; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:normal; padding:16px; overflow:auto; background-color:rgb(247,247,247); color:rgb(51,51,51); margin-top:0px!important; margin-bottom:0px!important"><code style="display:inline; overflow:visible; background-color:transparent; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-break:normal; border:0px; line-height:inherit; word-wrap:normal">labeltextColor = <span style="color:#dd1144">[UIColor whiteColor]</span>;</code></pre>
设置文字居中对齐,代码如下:
<pre style="font-size:11899999618530273px; line-height:145; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:normal; padding:16px; overflow:auto; background-color:rgb(247,247,247); color:rgb(51,51,51); margin-top:0px!important; margin-bottom:0px!important"><code style="display:inline; overflow:visible; background-color:transparent; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-break:normal; border:0px; line-height:inherit; word-wrap:normal"><span style="font-weight:700">label</span>textAlignment = NSTextAlignmentCenter;</code></pre>
设置文字显示内容,代码如下:
<pre style="font-size:11899999618530273px; line-height:145; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:normal; padding:16px; overflow:auto; background-color:rgb(247,247,247); color:rgb(51,51,51); margin-top:0px!important; margin-bottom:0px!important"><code style="display:inline; overflow:visible; background-color:transparent; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-break:normal; border:0px; line-height:inherit; word-wrap:normal">label<span style="color:#445588; font-weight:700">text</span> = @<span style="color:#dd1144">"Jay"</span>;</code></pre>
将文字添加到 toolBar 上进行显示,代码如下:
<pre style="font-size:11899999618530273px; line-height:145; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:normal; padding:16px; overflow:auto; background-color:rgb(247,247,247); color:rgb(51,51,51); margin-top:0px!important; margin-bottom:0px!important"><code style="display:inline; overflow:visible; background-color:transparent; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-break:normal; border:0px; line-height:inherit; word-wrap:normal"><span style="color:#9900; font-weight:700">[toolBar addSubview:label]</span><span style="color:#999988; font-style:italic">;</span></code></pre>
运行模拟器,效果如下:
至此,全部代码写完,完成今天毛玻璃效果的效果演示,完整代码如下:
<pre style="font-size:11899999618530273px; line-height:145; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:normal; padding:16px; overflow:auto; background-color:rgb(247,247,247); color:rgb(51,51,51); margin-top:0px!important; margin-bottom:0px!important"><code style="display:inline; overflow:visible; background-color:transparent; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-break:normal; border:0px; line-height:inherit; word-wrap:normal">- (<span style="font-weight:700">void</span>)viewDidLoad { [<span style="font-weight:700">super</span> viewDidLoad]; <span style="color:#999988; font-style:italic">// 第一步:对进行处理</span> <span style="color:#086b3">UIImageView</span> imageView = [[<span style="color:#086b3">UIImageView</span> alloc]init]; imageView<span style="color:teal">frame</span> = <span style="font-weight:700">self</span><span style="color:teal">view</span><span style="color:teal">bounds</span>; imageView<span style="color:teal">image</span> = [<span style="color:#086b3">UIImage</span> imageNamed:<span style="color:#dd1144">@"Jayjpg"</span>]; imageView<span style="color:teal">contentMode</span> = <span style="color:#086b3">UIViewContentModeScaleToFill</span>; <span style="color:#999988; font-style:italic">// 第二步:制作毛玻璃</span> <span style="color:#086b3">UIToolbar</span> toolBar = [[<span style="color:#086b3">UIToolbar</span> alloc]init]; toolBar<span style="color:teal">frame</span> = imageView<span style="color:teal">bounds</span>; toolBar<span style="color:teal">barStyle</span> = <span style="color:#086b3">UIBarStyleBlack</span>; [imageView addSubview:toolBar]; <span style="color:#999988; font-style:italic">// 第三步:添加文字</span> <span style="color:#086b3">UILabel</span> label = [[<span style="color:#086b3">UILabel</span> alloc]init]; label<span style="color:teal">frame</span> = <span style="color:#086b3">CGRectMake</span>(<span style="font-weight:700">self</span><span style="color:teal">view</span><span style="color:teal">frame</span><span style="color:teal">size</span><span style="color:teal">width</span>/<span style="color:teal">2</span>-<span style="color:teal">50</span>, <span style="font-weight:700">self</span><span style="color:teal">view</span><span style="color:teal">frame</span><span style="color:teal">size</span><span style="color:teal">height</span>/<span style="color:teal">2</span>+<span style="color:teal">150</span>, <span style="color:teal">100</span>, <span style="color:teal">100</span>); label<span style="color:teal">textColor</span> = [<span style="color:#086b3">UIColor</span> whiteColor]; label<span style="color:teal">textAlignment</span> = <span style="color:#086b3">NSTextAlignmentCenter</span>; label<span style="color:teal">text</span> = <span style="color:#dd1144">@"Jay"</span>; [toolBar addSubview:label]; [<span style="font-weight:700">self</span><span style="color:teal">view</span> addSubview:imageView]; }</code></pre>
4代越狱后在cydia里查找一款叫blurriedncbackground的插件,安装即可。iPhone 4是结合照相手机、个人数码助理、媒体播放器以及无线通信设备的掌上设备,iPhone4没有键盘,而是创新地引入了多点触摸(Multi-touch)触摸屏界面。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)