[android-developers] Android5.0 TextView gravity center not working Correctly

2014-12-12 Thread Gavin Qin
 

LinearLayout

android:layout_width=match_parent

android:layout_height=wrap_content

android:orientation=horizontal 


TextView

android:layout_width=0dp

android:layout_height=wrap_content

android:layout_weight=1

android:gravity=center

android:singleLine=true

android:text=Access control

android:textSize=20sp /


TextView

android:layout_width=0dp

android:layout_height=wrap_content

android:layout_weight=1

android:gravity=center

android:singleLine=true

android:text=Access control

android:textSize=20sp /


TextView

android:layout_width=0dp

android:layout_height=wrap_content

android:layout_weight=1

android:gravity=center

android:singleLine=true

android:text=Access control

android:textSize=20sp /


TextView

android:layout_width=0dp

android:layout_height=wrap_content

android:layout_weight=1

android:gravity=center

android:singleLine=true

android:text=Access control

android:textSize=20sp /

/LinearLayout

in android api 21 and android api20, it looks like the attachment.

why in android api21 ,the textview gravity not working Correctly.


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] android5.0 Textview gravity center not working correctly.

2014-12-12 Thread Gavin Qin
LinearLayout

android:layout_width=match_parent

android:layout_height=wrap_content

android:orientation=horizontal 



TextView

android:layout_width=0dp

android:layout_height=wrap_content

android:layout_weight=1

android:gravity=center

android:singleLine=true

android:text=Access control

android:textSize=20sp /



TextView

android:layout_width=0dp

android:layout_height=wrap_content

android:layout_weight=1

android:gravity=center

android:singleLine=true

android:text=Access control

android:textSize=20sp /



TextView

android:layout_width=0dp

android:layout_height=wrap_content

android:layout_weight=1

android:gravity=center

android:singleLine=true

android:text=Access control

android:textSize=20sp /



TextView

android:layout_width=0dp

android:layout_height=wrap_content

android:layout_weight=1

android:gravity=center

android:singleLine=true

android:text=Access control

android:textSize=20sp /

/LinearLayout

in android api 21 and android api20, it looks like the attachment.

why in android api21 ,the textview gravity not working Correctly.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] when drag view, the view blink

2010-09-16 Thread Gavin Qin
Hello, everyone.
 I have a problem about the view drag. when i drag the view, it will
blink. The code like below:
HorizontalScrollView android:id=@+id/HorizontalScrollView01
android:layout_below=@id/bomb_l
android:layout_width=wrap_content
android:layout_height=wrap_content 
android:scrollbars=none
android:layout_marginBottom=20dip
android:layout_marginTop=10dip
TableLayout android:id=@+id/TableLayout01
android:layout_width=wrap_content
android:layout_height=wrap_content
TableRow android:id=@+id/TableRow01
android:layout_width=wrap_content
android:layout_height=wrap_content
AbsoluteLayout 
android:id=@+id/answerSheet

android:layout_width=wrap_content
android:layout_height=wrap_content
 TextView 
android:text=@+id/TextView01 android:id=@+id/
TextView01


android:layout_width=wrap_content
android:layout_height=wrap_content /TextView
/AbsoluteLayout
/TableRow
/TableLayout
/HorizontalScrollView

when i want to drag  TextView01, the view will blink
@SuppressWarnings(deprecation)
@Override
public boolean onTouchEvent(MotionEvent event) {

if (isShowPress) {
int action = event.getAction();
switch (action  MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_DOWN:

return super.onTouchEvent(event);
case MotionEvent.ACTION_MOVE:
curX = event.getX();
curY = event.getY();


AbsoluteLayout.LayoutParams params = new
AbsoluteLayout.LayoutParams(
135, 200, (int) curX, (int) 
curY);
this.setLayoutParams(params);

break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
AbsoluteLayout.LayoutParams p = new 
AbsoluteLayout.LayoutParams(
135, 200, 135, 0);
this.setLayoutParams(p);

break;
default:
break;
}
}


return true;
}


how can solve this problem.
Thanks.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] when drag view, the view blink

2010-09-16 Thread Gavin Qin
Hello, everyone.
 I have a problem about the view drag. when i drag the view, it will
blink. The code like below:
HorizontalScrollView android:id=@+id/HorizontalScrollView01
android:layout_below=@id/bomb_l
android:layout_width=wrap_content
android:layout_height=wrap_content 
android:scrollbars=none
android:layout_marginBottom=20dip
android:layout_marginTop=10dip
TableLayout android:id=@+id/TableLayout01
android:layout_width=wrap_content
android:layout_height=wrap_content
TableRow android:id=@+id/TableRow01
android:layout_width=wrap_content
android:layout_height=wrap_content
AbsoluteLayout 
android:id=@+id/answerSheet

android:layout_width=wrap_content
android:layout_height=wrap_content
 TextView 
android:text=@+id/TextView01 android:id=@+id/
TextView01


android:layout_width=wrap_content
android:layout_height=wrap_content /TextView
/AbsoluteLayout
/TableRow
/TableLayout
/HorizontalScrollView

when i want to drag  TextView01, the view will blink
@SuppressWarnings(deprecation)
@Override
public boolean onTouchEvent(MotionEvent event) {

if (isShowPress) {
int action = event.getAction();
switch (action  MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_DOWN:

return super.onTouchEvent(event);
case MotionEvent.ACTION_MOVE:
curX = event.getX();
curY = event.getY();


AbsoluteLayout.LayoutParams params = new
AbsoluteLayout.LayoutParams(
135, 200, (int) curX, (int) 
curY);
this.setLayoutParams(params);

break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
AbsoluteLayout.LayoutParams p = new 
AbsoluteLayout.LayoutParams(
135, 200, 135, 0);
this.setLayoutParams(p);

break;
default:
break;
}
}


return true;
}


how can solve this problem.
Thanks.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en