当前位置:首页 » 安卓系统 » android纵向

android纵向

发布时间: 2023-02-02 15:15:00

❶ android textview文字纵向显示怎么弄

http://download.csdn.net/download/reasonwing/5339393

❷ 安卓Android-X86强制竖屏 安卓(Android)x86屏幕旋转解决方法

安卓(Android)x86运行应用出现屏幕旋转变成横屏了怎么办?难不成要把脖子旋转90度来看屏幕吗?方法当然是有的,下面小编就来教大家两个解决安卓(Android)x86屏幕旋转问题的方法,实现所有应用强制竖屏。
方法一:锁定屏幕方向(推荐)
在主界面顶部右侧往下拉,点击“自动旋转”图标开启屏幕方向锁定。
方法二:安装Orientation
Control
在Orientation
Control设置中选择“强制纵向”即可。

❸ 如何检查Android手机是横向还是纵向

用于确定要检索哪些资源的当前配置可从资源的Configuration对象中获得:

getResources().getConfiguration().orientation;

可以通过查看方向值来检查方向:

int orientation = getResources().getConfiguration().orientation;

if (orientation == Configuration.ORIENTATION_LANDSCAPE) {

// In landscape
} else {

// In portrait

}

❹ android中如何纵向显示RatingBar

看看这个 http://www.linuxidc.com/Linux/2011-11/46631.htm

❺ 在android textView中怎么实现文字的纵向的滚动

似乎textview没有纵向滚动属性,反正我没试出来,同楼上,建议用animation实现该效果,不过用不了那么多,2个就可以了,不知道楼主要在屏幕顶部实现还是其他位置? 刚才没事做了一个简单的例子,如果在顶部不用这么麻烦,写的特繁琐,把animation的各种属性都写上了,这样楼主可以根据不同的需要做修改.
package com.mygd;

import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.view.animation.AnimationSet;
import android.view.animation.TranslateAnimation;
import android.widget.LinearLayout;

public class gundongActivity extends Activity implements AnimationListener{
/** Called when the activity is first created. */
int i = 0;
Handler handler = new Handler();

// LinearLayout linearLayout1, linearLayout2, linearLayout3;
// AnimationSet animationSet1, animationSet2, animationSet3;
// TranslateAnimation
// translateAnimation1,translateAnimation2,translateAnimation3;
// AlphaAnimation alphaAnimation1, alphaAnimation2;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
LinearLayout linearLayout1 = (LinearLayout) findViewById(R.id.linearLayout1);
LinearLayout linearLayout2 = (LinearLayout) findViewById(R.id.linearLayout2);
LinearLayout linearLayout3 = (LinearLayout) findViewById(R.id.linearLayout3);
AnimationSet animationSet1 = new AnimationSet(true);
AnimationSet animationSet2 = new AnimationSet(true);
AnimationSet animationSet3 = new AnimationSet(true);
TranslateAnimation translateAnimation1 = new TranslateAnimation(
Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF,
0, Animation.RELATIVE_TO_SELF, 0,
Animation.RELATIVE_TO_SELF, -1);
TranslateAnimation translateAnimation2 = new TranslateAnimation(
Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF,
0, Animation.RELATIVE_TO_SELF, 0,
Animation.RELATIVE_TO_SELF, -0.5f);
TranslateAnimation translateAnimation3 = new TranslateAnimation(
Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF,
0, Animation.RELATIVE_TO_SELF, 0,
Animation.RELATIVE_TO_SELF, -1);
AlphaAnimation alphaAnimation1 = new AlphaAnimation(1, 0);
AlphaAnimation alphaAnimation2 = new AlphaAnimation(0, 1);
animationSet1.addAnimation(translateAnimation1);
animationSet1.addAnimation(alphaAnimation1);
animationSet1.setDuration(1500);
animationSet3.addAnimation(alphaAnimation2);
animationSet3.addAnimation(translateAnimation3);
animationSet3.setDuration(1500);
animationSet2.addAnimation(translateAnimation2);
animationSet2.setDuration(1500);
linearLayout1.startAnimation(animationSet1);
linearLayout2.startAnimation(animationSet2);
linearLayout3.startAnimation(animationSet3);
animationSet1.setFillAfter(true);
translateAnimation1.setRepeatCount(10);
translateAnimation2.setRepeatCount(10);
translateAnimation3.setRepeatCount(10);
alphaAnimation1.setRepeatCount(10);
alphaAnimation2.setRepeatCount(10);
animationSet2.setFillAfter(true);
animationSet3.setFillAfter(true);
animationSet1.setStartOffset(1000);
animationSet2.setStartOffset(1000);
animationSet3.setStartOffset(1000);
i++;
Log.d("xxx", "xxx"+i);
onAnimationEnd(animationSet1);
onAnimationEnd(animationSet2);
onAnimationEnd(animationSet3);
}
// else if(i%2==1){
// AnimationSet animationSet4 = new AnimationSet(true);
// AnimationSet animationSet5 = new AnimationSet(true);
// AnimationSet animationSet6 = new AnimationSet(true);
// TranslateAnimation translateAnimation4 = new TranslateAnimation(
// Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF,
// 0, Animation.RELATIVE_TO_SELF, 1,
// Animation.RELATIVE_TO_SELF, 0);
// TranslateAnimation translateAnimation5 = new TranslateAnimation(
// Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF,
// 0, Animation.RELATIVE_TO_SELF, 0.5f,
// Animation.RELATIVE_TO_SELF, 0);
// TranslateAnimation translateAnimation6 = new TranslateAnimation(
// Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF,
// 0, Animation.RELATIVE_TO_SELF, 1,
// Animation.RELATIVE_TO_SELF, 0);
// AlphaAnimation alphaAnimation3 = new AlphaAnimation(0, 1);
// AlphaAnimation alphaAnimation4 = new AlphaAnimation(1, 0);
// animationSet4.addAnimation(translateAnimation4);
// animationSet4.addAnimation(alphaAnimation3);
// animationSet4.setDuration(1500);
// animationSet6.addAnimation(alphaAnimation4);
// animationSet6.addAnimation(translateAnimation6);
// animationSet6.setDuration(1500);
// animationSet5.addAnimation(translateAnimation5);
// animationSet5.setDuration(1500);
// linearLayout1.startAnimation(animationSet4);
// linearLayout2.startAnimation(animationSet5);
// linearLayout3.startAnimation(animationSet6);
// animationSet4.setFillAfter(true);
// animationSet5.setFillAfter(true);
// animationSet6.setFillAfter(true);
// i++;
// Log.d("xx", "xxx"+i);
// }

@Override
public void onAnimationEnd(Animation arg0) {
// TODO Auto-generated method stub
handler.post(new Runnable() {

@Override
public void run() {
// TODO Auto-generated method stub
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
});
Log.d("xx", "end");
}

@Override
public void onAnimationRepeat(Animation arg0) {
// TODO Auto-generated method stub
Log.d("xx", "repeat");
}

@Override
public void onAnimationStart(Animation arg0) {
// TODO Auto-generated method stub
Log.d("xx", "start");
}
}
下面是xml.两个button主要是为了和顶部留有距离,
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<Button android:layout_height="wrap_content" android:text="Button" android:layout_width="fill_parent" android:id="@+id/button1"></Button>
<Button android:layout_height="wrap_content" android:text="Button" android:layout_width="fill_parent" android:id="@+id/button2"></Button>
<LinearLayout android:orientation="vertical" android:id="@+id/linearLayout1" android:layout_width="fill_parent" android:layout_height="20dp" android:layout_marginTop="50dp">
<TextView android:layout_height="wrap_content" android:text="@string/hello" android:layout_width="fill_parent" android:id="@+id/textView2"></TextView>
</LinearLayout>
<LinearLayout android:id="@+id/linearLayout2" android:layout_height="wrap_content" android:layout_width="fill_parent" android:orientation="vertical">
<TextView android:text="TextView" android:id="@+id/textView4" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
<TextView android:layout_height="wrap_content" android:text="TextView" android:layout_width="fill_parent" android:id="@+id/textView1"></TextView>
</LinearLayout>
<LinearLayout android:id="@+id/linearLayout3" android:layout_height="wrap_content" android:layout_width="fill_parent">
<TextView android:layout_height="wrap_content" android:text="1234567890" android:layout_width="wrap_content" android:id="@+id/textView3"></TextView>
</LinearLayout>
</LinearLayout>

❻ android Gallery怎么纵向显示

用动画旋转90度就可以纵向显示了,以下函数,RotateAnimation是android提供的类Gallery.startAnimaiton(RotateAnimation a)

❼ 如何强制Android相机以纵向模式显示,或者让我进行旋转

一般,安卓手机都是有设置的,然后你在相机里设置试一试,

❽ Android的一道题:如何实现:横向和纵向分别显示“赤橙黄绿青蓝紫”七个字,每个字显示为本身所表

java"><?xmlversion="1.0"encoding="utf-8"?>
<LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="赤"
android:textColor="#ff0000"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="橙"
android:textColor="#ff9600"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="黄"
android:textColor="#ffff00"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="绿"
android:textColor="#00ff00"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="青"
android:textColor="#00ff96"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="蓝"
android:textColor="#0000ff"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="紫"
android:textColor="#ff00ff"/>
</LinearLayout>

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="橙"
android:textColor="#ff9600"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="黄"
android:textColor="#ffff00"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="绿"
android:textColor="#00ff00"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="青"
android:textColor="#00ff96"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="蓝"
android:textColor="#0000ff"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="紫"
android:textColor="#ff00ff"/>
</LinearLayout>

</LinearLayout>

热点内容
app什么情况下找不到服务器 发布:2025-05-12 15:46:25 浏览:714
php跳过if 发布:2025-05-12 15:34:29 浏览:467
不定时算法 发布:2025-05-12 15:30:16 浏览:131
c语言延时1ms程序 发布:2025-05-12 15:01:30 浏览:166
动物园灵长类动物配置什么植物 发布:2025-05-12 14:49:59 浏览:737
wifi密码设置什么好 发布:2025-05-12 14:49:17 浏览:148
三位数乘两位数速算法 发布:2025-05-12 13:05:48 浏览:399
暴风影音缓存在哪里 发布:2025-05-12 12:42:03 浏览:544
access数据库exe 发布:2025-05-12 12:39:04 浏览:632
五开的配置是什么 发布:2025-05-12 12:36:37 浏览:366