es.davy.ai

Preguntas y respuestas de programación confiables

¿Tienes una pregunta?

Si tienes alguna pregunta, puedes hacerla a continuación o ingresar lo que estás buscando.

Tag: ANDROID-TEXTVIEW-AUTOSIZE

Al agregar un LinearLayout a ConstraintLayout, desaparecen los TextViews.

Creé un archivo xml de plantilla LinearLayout, que tiene una ImageView y 2 TextViews, y estoy intentando agregarlo a mi ConstraintLayout programáticamente. Si lo agrego a un LinearLayout: val layout: LinearLayout = root.findViewById(R.id.linearLayoutBlockSequence) val inflater = LayoutInflater.from(context) val linearLayout = inflater.inflate(R.layout.linearlayout_block, null, false) as LinearLayout linearLayout.id = View.generateViewId() layout.addView(linearLayout) Funciona . . . Read more

Android – ¿Cómo obtener el objeto actualmente “enfocado”?

Quiero permitir que un botón identifique qué de mis TextViews tiene el enfoque actual. Y después de eso, el botón necesita aplicar cambios al TextView enfocado. TextView textView11 = (TextView) findViewById(R.id.frame1_1); textView11.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { textView11.setBackgroundColor(Color.LTGRAY); textView11.setFocusableInTouchMode(true); textView11.requestFocus(); } }); MaterialButton pb1 = (MaterialButton) findViewById(R.id.pin_button_1); . . . Read more