我想用Eclipse文件在Eclipse中安装ADT插件,但是当我点击安装第一页的下一个按钮时,进度很晚了.我等待3小时,我等待安装,但现在半ADT安装:(
在安装窗口,进度条上方,写道:无法执行操作.计算备用解决方案,可能需要一段时间:7/15.
为什么安装ADT需要很长时间?这没问题或安装有问题吗?
抱歉我的英语不好,谢谢你的帮助
我想通过TextView和strings.xml显示多行.我想先显示几行,直到页面中间,其他行显示完整的页面.我想先显示几行宽度相同的页面.
页面左侧是图片,页面右侧是我的句子.
这是我的代码,但这显示了搞砸.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<ImageView
android:id="@+id/logoImage"
android:src="@drawable/ic_launcher"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/txtIntroduce"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/txtIntroduce"
android:textColor="@color/blue_text"
android:background="@color/blue"/>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
strings.xml中:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="intro">................. ....</string>
<resources>
Run Code Online (Sandbox Code Playgroud)
我该如何展示这种观点?抱歉我的英语很差,谢谢你的帮助.
我在RelativeLayout的顶部放置了一个ImageView,但图像没有显示在页面顶部.我搜索了互联网并添加android:scaleType="fitStart"了问题并解决了问题,但是图像在页面中获得了更多空间,因为当我在此图像下方添加第二个图像时,第二个图像显示在页面的中心!问题是什么?我怎么解决这个问题?我尝试使用LinearLayout产生相同结果的a.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageView
android:id="@+id/registerAction"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:scaleType="fitStart"
android:src="@drawable/register_action" />
<ImageView
android:id="@+id/registerLogo"
android:src="@drawable/app_pass"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_below="@id/registerAction"/>
<EditText
android:id="@+id/pass1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/registerLogo"
android:paddingTop="15dp"
android:layout_marginRight="10dp"
android:layout_marginLeft="10dp"
android:inputType="textPassword"
android:hint="@string/pass1"
android:gravity="right"/>
<EditText
android:id="@+id/pass2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/pass1"
android:paddingTop="15dp"
android:layout_marginRight="10dp"
android:layout_marginLeft="10dp"
android:inputType="textPassword"
android:hint="@string/pass2"
android:gravity="right"/>
<Button
android:id="@+id/btn"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/pass2"
android:paddingRight="10dp"
android:paddingLeft="10dp"
android:paddingTop="30dp"/>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
Thanks.Cheers
编辑:和另一个问题如何在EditText下面填充Button 30dp?当我更改Button的PaddingTop时没有改变Button的位置.
我想把我的按钮移动到另一个触摸的位置.我的意思是,如果用户触摸一个按钮并通过触摸转到另一个地方,则按钮会移动.我为其中一个按钮编写了这个代码,但是当我触摸一个按钮时,三个按钮移动以及一个按钮无法向右或向左移动,当我移动到屏幕顶部时,图像按钮的一部分被删除!
问题是什么?我该如何解决这个问题?我想在android +2.2中运行这个程序
onButton.setOnTouchListener(new OnTouchListener(){
@Override
public boolean onTouch(View v, MotionEvent event) {
// TODO Auto-generated method stub
switch(event.getAction()){
case MotionEvent.ACTION_MOVE:
RelativeLayout.LayoutParams relativeLayout=(RelativeLayout.LayoutParams) oneButton.getLayoutParams();
int x=(int)event.getRawX();
int y=(int)event.getRawY();
relativeLayout.leftMargin=x-50;
relativeLayout.rightMargin=x-50;
relativeLayout.topMargin=y-50;
relativeLayout.bottomMargin=y-50;
oneButton.setLayoutParams(relativeLayout);
break;
default:
break;
}
return true;
}
});
Run Code Online (Sandbox Code Playgroud)
XML:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageView
android:id="@+id/img"
android:src="@drawable/root"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:adjustViewBounds="true"
android:scaleType="fitXY"/>
<ImageButton
android:id="@+id/btnOne"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="35dip"
android:layout_alignParentTop="true"
android:layout_marginTop="70dip"
android:src="@drawable/oneButton"
android:background="@null"
android:visibility="invisible"/>
<ImageButton
android:id="@+id/btnTwo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="35dip"
android:layout_alignParentTop="true"
android:layout_marginTop="70dip"
android:src="@drawable/twoButton"
android:background="@null"
android:visibility="invisible"/>
<ImageButton …Run Code Online (Sandbox Code Playgroud) 我想保持按下显示的按钮。我想用另一种方法代替onTouch()中的onPressed()。我添加了setPressed(),setSelected(),但是没有用。当我在onTouch()中添加这些方法时,程序很好,但是动画非常慢。
我可以在onClick()方法中使用这些方法但可以在其中工作吗?请为我解释