IT之家訊蘋果在iphone6s/iPhone6s Plus的iOS9中加入了全新的3D Touch功能,用戶可以通過(guò)短時(shí)間加大按壓力度(Peek手勢(shì))來(lái)調(diào)出更多功能選項(xiàng),這種形式非常類似于右鍵菜單。而在最新的Win10預(yù)覽版10565中,只要稍加改動(dòng),就可以為Windows應(yīng)用右鍵菜單加入類似于3D Touch菜單效果的內(nèi)容。而且由于Windows10設(shè)備目前還不支持壓力感應(yīng),因此這項(xiàng)功能是通過(guò)Jump List跳轉(zhuǎn)列表的方式實(shí)現(xiàn),因此在Win10中使用這項(xiàng)功能毫無(wú)“壓力”。
▲Win10應(yīng)用新右鍵菜單
從效果圖來(lái)看,通過(guò)擴(kuò)展右鍵菜單的方式可以完全實(shí)現(xiàn)類似于3D Touch的所有功能。事實(shí)上,在Build 10565中使用Windowsbeta SDK v10563就可以編輯這項(xiàng)功能。不過(guò)需要注意的是,該版本SDK最好不要安裝在你用于開(kāi)發(fā)產(chǎn)品的系統(tǒng)上,因?yàn)橛迷摪姹鹃_(kāi)發(fā)的應(yīng)用目前無(wú)法發(fā)布。
▲iPhone6s 3D Touch菜單
在安裝完上述內(nèi)容后,你只需使用新的JumpList API進(jìn)行編輯即可,你可以使用該API自由定制Windows應(yīng)用右鍵菜單項(xiàng)目。因此有了這項(xiàng)權(quán)限,你便可以任意實(shí)現(xiàn)你想要的“3D Touch”功能。
以下為國(guó)外網(wǎng)站Martin Suchan給出的《相機(jī)》新右鍵菜單內(nèi)容實(shí)現(xiàn)代碼:
JumpList jumpList = await JumpList.LoadCurrentAsync();
jumpList.Items.Clear();
JumpListItem item1 = JumpListItem.CreateWithArguments("selfie", "Take Selfie");
item1.Logo = new Uri("ms-appx:///Assets/selfie.png");
JumpListItem item2 = JumpListItem.CreateWithArguments("video", "Record Video");
item2.Logo = new Uri("ms-appx:///Assets/cam.png");
JumpListItem item3 = JumpListItem.CreateWithArguments("slomo", "Record Slo-mo");
item3.Logo = new Uri("ms-appx:///Assets/slomo.png");
JumpListItem item4 = JumpListItem.CreateWithArguments("photo", "Take Photo");
item4.Logo = new Uri("ms-appx:///Assets/cam.png");
jumpList.Items.Add(item1);
jumpList.Items.Add(item2);
jumpList.Items.Add(item3);
jumpList.Items.Add(item4);
await jumpList.SaveAsync();
目前這項(xiàng)功能還沒(méi)有正式實(shí)現(xiàn),不過(guò)既然Win10預(yù)覽版10565已經(jīng)可以通過(guò)這種方式對(duì)應(yīng)用進(jìn)行編輯修改,那就意味著離正式到來(lái)已經(jīng)不遠(yuǎn)。(Source:Martin Suchan)
玩轉(zhuǎn)Win10,盡在IT之家Win10特別專題>>
新聞熱點(diǎn)
疑難解答
圖片精選