第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

老師 我想問(wèn) 如果主按鈕 在中間 item呈180°散開 怎么做

老師 我想問(wèn) 如果主按鈕 在中間 ?item呈180°散開 怎么做

正在回答

1 回答

散開路徑:

int?l1?=?(int)?(mRadius?*?Math.sin(Math.PI?/?count?*?(i?+?1)));
int?t1=?(int)?(mRadius?*?Math.cos(Math.PI?/?count?*?(i?+?1)));

int?xflag?=?1;
int?yflag?=?1;
AnimationSet?animset?=?new?AnimationSet(true);
Animation?tranAnim?=?null;
if?(mCurrentStatus?==?Status.CLOSE)
{
????tranAnim?=?new?TranslateAnimation(xflag?*?t1,?0,?yflag?*?l1,?0);
????childView.setClickable(true);
????childView.setFocusable(true);
}
else
{
????tranAnim?=?new?TranslateAnimation(0,?xflag?*?t1,?0,?yflag?*?l1);
????childView.setClickable(false);
????childView.setFocusable(false);
}

主菜單和子菜單定位:

protected?void?onLayout(boolean?changed,?int?l,?int?t,?int?r,?int?b)?{
????if?(changed){
????????layoutCButton();
????????int?count?=?getChildCount();
????????for?(int?i=0;i<count-1;i++){
????????????View?child?=?getChildAt(i+1);
????????????child.setVisibility(View.GONE);
????????????int?t1?=?(int)?(mRadius?*?Math.sin(Math.PI?/?count?*?(i?+?1)));
????????????int?l1=?(int)?(mRadius?*?Math.cos(Math.PI?/?count?*?(i?+?1)));

????????????int?width?=?child.getMeasuredWidth();
????????????int?height?=?child.getMeasuredHeight();
????????????l?=?getMeasuredWidth()?/?2?-?width?/?2?-?l1;
????????????t?=?getMeasuredHeight()?-?height?-?t1;

????????????child.layout(l,?t,?l?+?width,?t?+?height);
????????}

????}

}

private?void?layoutCButton()?{
????mCButton?=?getChildAt(0);
????mCButton.setOnClickListener(this);

????int?l?=?0;
????int?t?=?0;

????int?width?=?mCButton.getMeasuredWidth();
????int?height?=?mCButton.getMeasuredHeight();
????switch?(mPosition){
????????case?CENTER:
????????????l?=?getMeasuredWidth()?/?2?-?width?/?2;
????????????t?=?getMeasuredHeight()?-?height;
????????????break;
????}
????mCButton.layout(l,?t,?l?+?width,?t?+?height);
}


1 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消
Android實(shí)現(xiàn)衛(wèi)星菜單
  • 參與學(xué)習(xí)       26324    人
  • 解答問(wèn)題       59    個(gè)

學(xué)習(xí)仿Path的衛(wèi)星式菜單,課程涵蓋了自定義控件的整個(gè)過(guò)程

進(jìn)入課程

老師 我想問(wèn) 如果主按鈕 在中間 item呈180°散開 怎么做

我要回答 關(guān)注問(wèn)題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)