解决方案 »
- eclipse创建类 能继承expandablelistadatper无法继承baseexpandablelistadapter 如何解决?
- 关于listview的点击响应事件的问题
- ContactsContract.RawContacts类的作用
- ontouch事件遇到的问题
- 我在调试hello Ophone 时出错,谁来帮忙指导一下。谢谢。
- 多点触控求助
- 多线程HandlerThread和getLooper
- incoming call 与 outgoing call
- 像微信朋友圈,点评论时弹出一个“赞和评论”的框,要怎么做
- activity关闭之后页面卡住了
- 寻找思路,指点一下别人这效果怎么实现的
- android源码编译出错
背景2------>B layout
登陆框------>C layout把A.B.C三个layout覆盖在一起,默认B.C隐藏。当点击A 布局时隐藏A,展现B,同时展现C(给C写一个上拉的动画)
下面是布局文件,其中的图片自己加
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/login_bg"
android:orientation="vertical" > <RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" > <ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="@drawable/logo11w" />
</RelativeLayout> <LinearLayout
android:id="@+id/bottom"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical"
android:visibility="gone"
> <EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/app_name"
android:textSize="16sp"
/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/app_name"
android:textSize="16sp"
/>
</LinearLayout></LinearLayout>
下面是代码
package com.example.testjson;import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.TranslateAnimation;
import android.widget.LinearLayout;public class MainActivity extends Activity { private LinearLayout bottom;
private Animation mShowAction;
private Handler mHandler=new Handler(){
public void handleMessage(android.os.Message msg) {
bottom.setAnimation(mShowAction);
bottom.setVisibility(View.VISIBLE);
};
};
private Runnable r = new Runnable() {
@Override
public void run() {
try {
Thread.sleep(2000);
Message msg=new Message();
mHandler.sendMessage(msg);
} catch (Exception e) {
e.printStackTrace();
}
}
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
bottom=(LinearLayout)findViewById(R.id.bottom);
mShowAction = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0.0f,
Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF,
1.0f, Animation.RELATIVE_TO_SELF, 0.0f);
mShowAction.setDuration(500);
Thread t=new Thread(r);
t.start();
}
}