當前位置:首頁 » 安卓系統 » 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>

熱點內容
java上傳顯示圖片 發布:2024-02-24 23:06:31 瀏覽:654
flash存儲器作用 發布:2024-02-24 22:35:14 瀏覽:476
安卓吃雞手游在哪裡精彩回放 發布:2024-02-24 21:17:54 瀏覽:493
地理交叉演算法 發布:2024-02-24 21:17:07 瀏覽:751
劍無聲安卓版哪裡可以下載 發布:2024-02-24 21:14:44 瀏覽:848
金鏟鏟之戰電腦騰訊模擬器伺服器滿了 發布:2024-02-24 21:02:29 瀏覽:378
微信緩存的m4a文件 發布:2024-02-24 21:01:52 瀏覽:978
安卓光遇櫻花任務什麼時候結束 發布:2024-02-24 21:01:48 瀏覽:23
ogp的編程 發布:2024-02-24 19:42:20 瀏覽:489
sql回滾事務 發布:2024-02-24 19:34:22 瀏覽:445