編輯:關於Android編程
效果圖:
<喎?/kf/ware/vc/" target="_blank" class="keylink">vcD4KPHA+1sbX98u8wrejujwvcD4KPHA+MaGiz8i31s721eK49tCnufujrMbkyrW/ydLUwO294s6qsNHI/by2ssu1pbfWs8lsZXZlbDEsbGV2ZWwyLGxldmVsM6OsbGV2ZWwxysfKvNbVz9TKvrXEoaO147v3bGV2ZWwxuvOjrGxldmVsMrvhs/bP1qO7teO792xldmVsMrrzo6xsZXZlbDO74bP2z9aju2xldmVsMixsZXZlbDOz9s/WuvOjrLXju/dsZXZlbDGjrGxldmVsMrrNbGV2ZWwztry74c/7yqeho8i7uvPP+8qnus2z9s/WztLDx9PDtb3By9K7uPa2r7ut0Ke5+6GjPC9wPgo8cD4yoaK2r7ut0Ke5+9PDtb21xMrHUm90YXRlQW5pbWF0aW9uo6zTydPaztLDx7a8ysfTw82s0ru49tCnufujrMTHw7TO0sPH1rvSqtC00ru49sDgo6yw0dCnufvKtc/Wwcu+zb/J0tTBy6Gj0qrKx8q508NSb3RhdGVBbmltYXRpb261xLuwo6zO0sPHu+Gyu7bPtcS4tNPD0rvQqbT6wuujrNXi0fm/qreitcTQp8LKu+GxyL3Ptc2hozwvcD4KPHA+M6GiUm90YXRlQW5pbWF0aW9utcTQ/deqvfjI67rN0P3XqrP2yKXKx7j2v9OhqqGq0vLOqsv7ysfU2ljW4cuzyrHV67e9z/LQ/deqtcSho7TzvNK/ydLUv7S/tM28o7o8L3A+CjxwPjxpbWcgc3JjPQ=="/uploadfile/Collfiles/20141121/20141121090649165.png" alt="\">
整體思路就是這樣,接下來就是一些操作了:
代碼:
1、MyAnimation類:
public class MyAnimation{ public static void animationIn(View view){ animationIn(view,0); } public static void animationOut(View view){ animationOut(view,0); } public static void animationIn(View view,long delay){ RotateAnimation animation = new RotateAnimation(180, 360, view.getWidth()/2, view.getHeight()); animation.setDuration(500); animation.setFillAfter(true); animation.setStartOffset(delay); view.startAnimation(animation); } public static void animationOut(View view,long delay){ RotateAnimation animation = new RotateAnimation(0, 180, view.getWidth()/2, view.getHeight()); animation.setDuration(500); animation.setFillAfter(true); animation.setStartOffset(delay); view.startAnimation(animation); } }
public class MainActivity extends Activity implements OnClickListener{ private boolean isLevel2showed,isLevel3showed; private RelativeLayout level1,level2,level3; private ImageButton home,menu; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); isLevel2showed = false; isLevel3showed = false; initLayout(); initImageButton(); } public void initLayout() { level1 = (RelativeLayout)findViewById(R.id.relate_level1); level2 = (RelativeLayout)findViewById(R.id.relate_level2); level3 = (RelativeLayout)findViewById(R.id.relate_level3); level2.setVisibility(View.INVISIBLE); level3.setVisibility(View.INVISIBLE); } public void initImageButton() { home = (ImageButton)level1.findViewById(R.id.home); menu = (ImageButton)level2.findViewById(R.id.menu); home.setOnClickListener(this); menu.setOnClickListener(this); } @Override public void onClick(View v) { switch(v.getId()){ case R.id.home: if(!isLevel2showed){ isLevel2showed = true; MyAnimation.animationIn(level2); }else if(!isLevel3showed){ isLevel2showed = false; MyAnimation.animationOut(level2); }else{ isLevel2showed = false; isLevel3showed = false; MyAnimation.animationOut(level3); MyAnimation.animationOut(level2,500); } break; case R.id.menu: if(!isLevel3showed){ isLevel3showed = true; MyAnimation.animationIn(level3); }else{ isLevel3showed = false; MyAnimation.animationOut(level3); } break; } } }
圓角效果: import android.app.Activity; import android.graphics.Bitmap; import andr
目錄一、微服務架構模式1.1 模式描述 1.2 模式拓撲 1.3 避免依賴與調度 1.4 注意事項 1.5 模式分析 二、Android中的微服務架構 三、結語前段時間我
本文演示如何在Android中實現ListView圓角效果。無論是網站,還是APP,人們都愛看一些新穎的視圖效果。直角看多了,就想看看圓角,這幾年刮起了一陣陣的圓角設計風
在Android開發中,大部分控件都有visibility這個屬性,其屬性有3個分別為“visible ”、“invisible”、“gone”。主要用來設置控制控件的顯