Note that there are some explanatory texts on larger screens.

plurals
  1. PORelativeLayout layout_torightof not working with custom view class
    text
    copied!<p>Hi I am trying to position my custom view class in my main relative layout.</p> <p>The relativelayout layout_torightof is not working in xml layout and causing teh other views to draw on my custom view class. Here is my code.</p> <pre><code>public class LeftNavBarUI extends RelativeLayout implements OnClickListener { TextView facebook, twitter; private static Context mContext; public LeftNavBarUI(Context context, AttributeSet attrs) { super(context); mContext = context; LayoutInflater li = (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); li.inflate(R.layout.leftbar, this); facebook = (TextView) findViewById(R.id.facebook); twitter = (TextView) findViewById(R.id.twitter); facebook.setOnClickListener(this); twitter.setOnClickListener(this); } @Override public void onClick(View v) { Intent intent = new Intent(); intent.setClass(mContext, AlbumActivity.class); switch(v.getId()){ case R.id.facebook: { intent.putExtra(AppConstants.PROVIDER_NAME, "facebook"); mContext.startActivity(intent); break; } case R.id.twitter: /** AlerDialog when click on Exit */ { intent.putExtra(AppConstants.PROVIDER_NAME, "twitter"); mContext.startActivity(intent); break; } } } } </code></pre> <p></p> <pre><code>&lt;org.labs.lifeviewmobile.ui.LeftNavBarUI android:id="@+id/leftbar" android:layout_width="wrap_content" android:layout_height="wrap_content" /&gt; &lt;TextView android:id="@+id/title" style="@style/ActionBarView_TabText" android:layout_width="fill_parent" android:layout_height="30dip" android:textStyle="bold" android:textSize="13sp" android:background="@drawable/bar_gradient" android:layout_toRightOf="@+id/leftbar" android:paddingLeft="7dip" android:paddingBottom="5dip" android:paddingTop="5dip" /&gt; &lt;GridView android:id="@+id/gridview" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/title" android:animateLayoutChanges="true" android:clipChildren="true" android:gravity="top" android:layout_toRightOf="@+id/leftbar" android:listSelector="@drawable/image_background" android:numColumns="4" android:padding="10dip" android:paddingTop="10dp" android:scrollbarFadeDuration="0" android:scrollbarStyle="outsideOverlay" android:visibility="gone" android:scrollbars="vertical" /&gt; &lt;TextView android:id="@+id/blank_message" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toRightOf="@+id/leftbar" android:layout_centerVertical="true" android:textStyle="bold" android:textSize="13sp" android:textColor="#ffffff" android:paddingLeft="125dp" /&gt; &lt;ProgressBar android:id="@+id/pbar" style="@android:style/Widget.ProgressBar.Small" android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="gone" android:layout_centerInParent="true" /&gt; </code></pre> <p></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload