2014-10-05 3 views

답변

1

로딩 아이콘이 회전하는 방향이 아니라 메시지를 의미한다고 가정합니다. 여기에서

TextView message = (TextView) dialog.findViewById(android.R.id.message); 
message.setGravity(Gravity.RIGHT); 

: 그렇다면, 대신 대화 상자의 텍스트를 대상으로 시도 Set right gravity to a message inside a ProgressDialog

+0

을 방법이 없습니다 로딩 아이콘을 오른쪽으로 변경 하시겠습니까? –

+0

위의 예에서 'message'대신 'spinner'와 같은 스피너/진행 막대의보기를 찾아서 중력을 설정해보십시오. 지금은 테스트 할 수 없으므로보기가 실제로 '회 전자 (spinner)'라고 할 수는 없지만 제대로 작동 할 것이라고 생각합니다. – ipavl

0

이 시도 :

public class MainActivity extends ActionBarActivity { 

    @Override 
    protected void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     setContentView(R.layout.activity_main); 
     View v = getLayoutInflater().inflate(R.layout.right_spin, null); 
     TextView txt = (TextView)v.findViewById(R.id.txt); 
     txt.setText("arabic words"); 
     ProgressDialog dialog = new ProgressDialog(this); 
     dialog.show(); 
     dialog.setContentView(v); 
    } 

right_spin.xml

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:id="@+id/root" 
    android:background="#FFFFFF" > 


     <ProgressBar 
     android:id="@+id/progress" 
     android:layout_margin="16dip" 
     android:layout_alignParentRight="true" 
     android:layout_centerVertical="true" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" /> 

    <TextView 
     android:id="@+id/txt" 
     android:layout_margin="16dip" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_centerVertical="true" 
     android:layout_toLeftOf="@id/progress" /> 

</RelativeLayout> 
관련 문제