Tuesday, February 11, 2014

I ask questions about the ViewFlipper




ViewFlipper placed the TextView. Above chart shows. Middle of the upper and lower black areas are placed in two TextView.

Questions and I can only black area is conducted outside ViewFlipper gestures, such as flip, while in TextView can not flip, I ask where is the problem of?

About ViewFlipper's layout:
android: id = "@ + id / contentFlipper"
android: layout_width = "fill_parent"
android: layout_height = "wrap_content"
android: layout_below = "@ id / topText"
android: paddingBottom = "10dip"
android: paddingRight = "10dip"
android: paddingLeft = "10dip" />

About the TextView into ViewFlipper code:

flipper = (ViewFlipper) findViewById (R.id.contentFlipper);

for (int i = showPage; i TextView showText = new TextView (this);
showText.setMovementMethod (ScrollingMovementMethod.getInstance ());
showText.setMaxLines (25);
showText.setText (content [i - 1]);
showText.setTextColor (R.color.contentColor);
showText.setTextSize (TypedValue.COMPLEX_UNIT_PX, fontSize);
showText.setFocusable (true);
showText.setMovementMethod (ScrollingMovementMethod.getInstance ());


flipper.addView (showText);
}

I used to cycle to generate TextView of pages.
Reply:
Have the expert guidance you thank you.
Reply:
showText.setFocusable (false);
Reply:
reference to the second floor of the reply:
showText.setFocusable (false);

Tested useless ~
Reply:
showText.setMovementMethod for the birds set twice.
This is something a setting, setFocusable set up on the white.
Reply:
ViewFlipper own showNext () function where you call?
Reply:
references, 4th Floor reply:
showText.setMovementMethod for bird set twice.
This is something a setting, setFocusable set up on the white.


Thank correction. Those two settings are used to test the actual meaningless. Has been removed. Still no effect.
Reply:
Estimated to be another code problem, this horse can not see God.
Reply:
references, 5th Floor reply:
ViewFlipper own showNext () function where are you calling?

In onFling years, this is actually not wrong.

Reply:
The problem finale I quoted onTouchListener interface code generation TextView adding a listener:
showText.setOnTouchListener (this);

Listeners in return this.detector.onTouchEvent (event);
a detector for detecting a gesture event.

Strange place is not on the set textview demo page where you can directly monitor the event and I have to set this.
Reply:
I have encountered a problem is this: After the activity which added OnGestureListener, in textview above also added art_info.setMovementMethod (ScrollingMovementMethod.getInstance ()); finally realized that not all of the above in textview slide, I suspect that the event is a method captured inside

No comments:

Post a Comment