juliana_cora 2 de jun. de 2011
1°) Não estou conseguindo incluir uma textView acima do resultado do jogo 1 x 1 e acima seria Pacaembu como exemplo. Pois precisaria incluir mais um Linear e não sei incluir isso no codigo pela api ai seria 2 lineares correto???
2°) Acima é um campo com rolagem horizontal, ira visualizar os ultimos e proximos jogos, e cada jogo teria que clicar para chamar uma tela de ficha tecnica, e não sei como fazer esse componentes ser clicavel…
Acho que agora deu pra entender…rsrsrs
Aguardo retorno…
juliana_cora 2 de jun. de 2011
Ve se é mais ou menos isso j0nny…
Inclui mais um linear verticar no meu codigo para alinhar o jogo e o resultado abaixo do jogo
<LinearLayout xmlns:android= "http://schemas.android.com/apk/res/android"
android:id= "@+id/linearScroll"
android:layout_width= "fill_parent"
android:layout_height= "fill_parent"
android:orientation= "horizontal"
android:background= "#FFFFFF" >
<LinearLayout xmlns:android= "http://schemas.android.com/apk/res/android" //inclui aqui mais um linear
android:id= "@+id/linearScroll2"
android:layout_width= "fill_parent"
android:layout_height= "fill_parent"
android:orientation= "vertical"
android:background= "#FFFFFF" >
</LinearLayout>
na classe
if ( mandante.equals ( "Sim" ))
{
ImageView imgMandante = new ImageView ( this );
imgMandante.setImageResource ( R.drawable.guarani );
layout.addView ( imgMandante );
TextView local = new TextView ( this ); //*inclui aqui o local por exemplo pacaembu que ficara acima do resultado*/
local . setGravity ( Gravity.CENTER );
local . setTextColor ( Color.BLACK );
//local.setWidth(150);
local . setLayoutParams ( new LayoutParams ( LayoutParams.WRAP_CONTENT , LayoutParams.WRAP_CONTENT ));
local . setText ( topo.getLocal ());
layoutLocal.addView ( local );
TextView resultado = new TextView ( this );
resultado.setWidth ( 150 );
resultado.setGravity ( Gravity.CENTER );
resultado.setTextColor ( Color.BLACK );
resultado.setLayoutParams ( new LayoutParams ( LayoutParams.FILL_PARENT , LayoutParams.FILL_PARENT ));
resultado.setText ( topo.getJogos ());
layout.addView ( resultado );
ImageView imgAdversario = new ImageView ( this );
images.setUrlImagem ( topo.getStringUrlEscudoAdv ());
imgAdversario.setImageBitmap ( images.LoadImage ( bmOptions ));
layout.addView ( imgAdversario );
}
Mais fazendo isso precisaria Ex layout.addView(layout2) mais da erro…
poderia me dar uma ajudinha…
Aguardo retorno;…
juliana_cora 2 de jun. de 2011
Está dando erro j0nny,
inclui mais um parametro no meu metodo…(public void loadTopo(List xmlLista, LinearLayout layout, LinearLayout layout2)
e o que vc me falou…
ImageView imgMandante = new ImageView ( this );
imgMandante.setImageResource ( R.drawable.guarani );
layout.addView ( imgMandante );
TextView local = new TextView ( this );
local . setGravity ( Gravity.CENTER );
local . setTextColor ( Color.BLACK );
local . setLayoutParams ( new LayoutParams ( LayoutParams.WRAP_CONTENT , LayoutParams.WRAP_CONTENT ));
local . setText ( topo.getLocal ());
layout2.addView ( local );
TextView resultado = new TextView ( this );
resultado.setWidth ( 150 );
//resultado.setHeight(100);
resultado.setGravity ( Gravity.CENTER );
resultado.setTextColor ( Color.BLACK );
resultado.setLayoutParams ( new LayoutParams ( LayoutParams.FILL_PARENT , LayoutParams.FILL_PARENT ));
resultado.setText ( topo.getJogos ());
layout2.addView ( resultado );
ImageView imgAdversario = new ImageView ( this );
images.setUrlImagem ( topo.getStringUrlEscudoAdv ());
imgAdversario.setImageBitmap ( images.LoadImage ( bmOptions ));
layout.addView ( imgAdversario );
layout.addView ( layout2 , new LayoutParams ( LayoutParams.FILL_PARENT ,
LayoutParams.FILL_PARENT ));
Seria assim??
06 - 02 16 : 38 : 41.814 : ERROR / AndroidRuntime ( 6238 ): FATAL EXCEPTION : main
06 - 02 16 : 38 : 41.814 : ERROR / AndroidRuntime ( 6238 ): java . lang . RuntimeException : Unable to start activity ComponentInfo { br . com . logicadigital . activity / br . com . logicadigital . activity . ListaActivity }: java . lang . IllegalStateException : The specified child already has a parent . You must call removeView () on the child 's parent first.
06 - 02 16 : 38 : 41.814 : ERROR / AndroidRuntime ( 6238 ): at android . app . ActivityThread . performLaunchActivity ( ActivityThread . java : 1647 )
06 - 02 16 : 38 : 41.814 : ERROR / AndroidRuntime ( 6238 ): at android . app . ActivityThread . handleLaunchActivity ( ActivityThread . java : 1663 )
06 - 02 16 : 38 : 41.814 : ERROR / AndroidRuntime ( 6238 ): at android . app . ActivityThread . access $ 1500 ( ActivityThread . java : 117 )
06 - 02 16 : 38 : 41.814 : ERROR / AndroidRuntime ( 6238 ): at android . app . ActivityThread $ H . handleMessage ( ActivityThread . java : 931 )
06 - 02 16 : 38 : 41.814 : ERROR / AndroidRuntime ( 6238 ): at android . os . Handler . dispatchMessage ( Handler . java : 99 )
06 - 02 16 : 38 : 41.814 : ERROR / AndroidRuntime ( 6238 ): at android . os . Looper . loop ( Looper . java : 123 )
06 - 02 16 : 38 : 41.814 : ERROR / AndroidRuntime ( 6238 ): at android . app . ActivityThread . main ( ActivityThread . java : 3683 )
06 - 02 16 : 38 : 41.814 : ERROR / AndroidRuntime ( 6238 ): at java . lang . reflect . Method . invokeNative ( Native Method )
06 - 02 16 : 38 : 41.814 : ERROR / AndroidRuntime ( 6238 ): at java . lang . reflect . Method . invoke ( Method . java : 507 )
06 - 02 16 : 38 : 41.814 : ERROR / AndroidRuntime ( 6238 ): at com . android . internal . os . ZygoteInit $ MethodAndArgsCaller . run ( ZygoteInit . java : 839 )
06 - 02 16 : 38 : 41.814 : ERROR / AndroidRuntime ( 6238 ): at com . android . internal . os . ZygoteInit . main ( ZygoteInit . java : 597 )
06 - 02 16 : 38 : 41.814 : ERROR / AndroidRuntime ( 6238 ): at dalvik . system . NativeStart . main ( Native Method )
06 - 02 16 : 38 : 41.814 : ERROR / AndroidRuntime ( 6238 ): Caused by : java . lang . IllegalStateException : The specified child already has a parent . You must call removeView () on the child 's parent first.
06 - 02 16 : 38 : 41.814 : ERROR / AndroidRuntime ( 6238 ): at android . view . ViewGroup . addViewInner ( ViewGroup . java : 1976 )
06 - 02 16 : 38 : 41.814 : ERROR / AndroidRuntime ( 6238 ): at android . view . ViewGroup . addView ( ViewGroup . java : 1871 )
06 - 02 16 : 38 : 41.814 : ERROR / AndroidRuntime ( 6238 ): at android . view . ViewGroup . addView ( ViewGroup . java : 1851 )
06 - 02 16 : 38 : 41.814 : ERROR / AndroidRuntime ( 6238 ): at br . com . logicadigital . activity . ListaActivity . loadTopo ( ListaActivity . java : 153 )
06 - 02 16 : 38 : 41.814 : ERROR / AndroidRuntime ( 6238 ): at br . com . logicadigital . activity . ListaActivity . onCreate ( ListaActivity . java : 105 )
06 - 02 16 : 38 : 41.814 : ERROR / AndroidRuntime ( 6238 ): at android . app . Instrumentation . callActivityOnCreate ( Instrumentation . java : 1047 )
06 - 02 16 : 38 : 41.814 : ERROR / AndroidRuntime ( 6238 ): at android . app . ActivityThread . performLaunchActivity ( ActivityThread . java : 1611 )
06 - 02 16 : 38 : 41.814 : ERROR / AndroidRuntime ( 6238 ): ... 11 more
juliana_cora 2 de jun. de 2011
Layout2 seria para organizar as 2 textView na vertical para que as 2 imagens que estaria fora do Layout2 ficasse ao lado…
juliana_cora 2 de jun. de 2011
Dá uma olhada no print que dei na tela…
acertei o meio mais as imagens ficaram uma do lado da outra…
juliana_cora 2 de jun. de 2011
juliana_cora 2 de jun. de 2011
Para ficar mais claro é assim que gostaria que ficasse…no xml
<HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#cccccc">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal"
android:background="#cccccc">
<ImageView android:id="@+id/escudo1"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_toLeftOf="@+id/resultado"
android:background="#ffffff"/>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/linearScroll2"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<TextView android:id="@+id/local"
android:layout_width="100dip"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/icon"
android:text="local"
android:textSize="15sp"
android:textColor="#333333"
android:gravity="center"
android:layout_centerHorizontal="true"/>
<TextView android:id="@+id/resultado"
android:layout_width="100dip"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/icon"
android:text="2X0"
android:textSize="15sp"
android:textColor="#333333"
android:gravity="center"
android:layout_centerInParent="true"/>
</LinearLayout>
<ImageView android:id="@+id/escudo2"
android:layout_width="60dp"
android:layout_height="60dp"
android:background="#ffffff"
android:layout_toRightOf="@+id/resultado"
android:scaleType="centerCrop"/>
</LinearLayout>
</HorizontalScrollView>
juliana_cora 3 de jun. de 2011
As ImagensView e as TextView…está buscando as informações do xml que criei…