2016-12-07 37 views
0

我已經開始創建一個錶盤。我希望將peek card更改爲自定義圖像。在圖像中,您會看到圍繞我希望改變的部分的紅色圓圈。我想讓一個人在屏幕底部彈出,這樣用戶就知道他有一個通知,就像這裏的image一樣。試想一下牆壁是表面的底部。Android Wear:我可以更改峯值卡的外觀嗎?

這可能嗎?

讓我知道,

謝謝!

+0

是的,這是最有可能成爲可能。請細化問題以獲得具體答案。 – David

回答

0

AFAIK,您可以將樣式應用於您的通知,例如BigPictureStyle, BigTextStyle or IndexStyle

下面是使用BigTextStyle的例子:

// Specify the 'big view' content to display the long 
// event description that may not fit the normal content text. 
BigTextStyle bigStyle = new NotificationCompat.BigTextStyle(); 
bigStyle.bigText(eventDescription); 

NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this) 
    .setSmallIcon(R.drawable.ic_event) 
    .setLargeIcon(BitmapFractory.decodeResource(getResources(), R.drawable.notif_background)) 
    .setContentTitle(eventTitle) 
    .setContentText(eventLocation) 
    .setContentIntent(viewPendingIntent) 
    .addAction(R.drawable.ic_map, getString(R.string.map), mapPendingIntent) 
    .setStyle(bigStyle); 

您可以創建你的活動佈局並將其嵌入您的通知中:https://developer.android.com/training/wearables/apps/layouts.html#CustomNotifications

+0

這不完全是我要找的。我想用另一張圖像替換被紅色包圍的預覽偷看卡。這個答案只改變了通知的大風格,而不是預覽偷看卡。 –

相關問題